home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / samba / patches / samba-1.018 / samba-1
Encoding:
Text File  |  1995-07-09  |  83.9 KB  |  2,677 lines

  1. diff -u -r --new-file last-version/docs/DIAGNOSIS.txt samba-1.9.14alpha9/docs/DIAGNOSIS.txt
  2. --- last-version/docs/DIAGNOSIS.txt    Sun Jul  2 20:32:08 1995
  3. +++ samba-1.9.14alpha9/docs/DIAGNOSIS.txt    Fri Jul  7 08:34:33 1995
  4. @@ -103,7 +103,7 @@
  5.  TEST 5:
  6.  -------
  7.  
  8. -run the command "nmbd -L ACLIENT -B ACLIENT"
  9. +run the command "nmbd -L '*' -B ACLIENT"
  10.  
  11.  You should get a "positive name query response" from the PC. If you
  12.  don't then the client software on the PC isn't installed correctly, or
  13. @@ -115,12 +115,14 @@
  14.  TEST 6:
  15.  -------
  16.  
  17. -run the command "nmbd -L ACLIENT"
  18. +run the command "nmbd -L '*'"
  19.  
  20.  This time we are trying the same as the previous test but are trying
  21. -it via a broadcast to the default broadcast address. 
  22. +it via a broadcast to the default broadcast address. All Netbios/TCPIP
  23. +hosts on the network should respond, although Samba may not catch all
  24. +of the responses in the short time it listens.
  25.  
  26. -If this doesn't give the same result as the previous test then nmbd
  27. +If this doesn't give a similar result to the previous test then nmbd
  28.  isn't correctly getting your broadcast address through its automatic
  29.  mechanism. In this case you should experiment with the -B option which
  30.  allows you to manually specify the broadcast address, overriding the
  31. @@ -242,9 +244,14 @@
  32.  ADDITIONAL NOTES
  33.  ----------------
  34.  
  35. -NOTE 1: If you have version 1.9.13 of Samba then the "nmbd -L ACLIENT
  36. --B ACLIENT" test may fail if your client doesn't export any shares. To
  37. +NOTE 1: 
  38. +
  39. +If you have version 1.9.13 of Samba then the "nmbd -L ACLIENT -B
  40. +ACLIENT" test may fail if your client doesn't export any shares. To
  41.  fix this either export a share or change the "lookup_type" in
  42.  nameserv.c from ' ' to 0 and recompile.
  43.  
  44. +Also the "wildcard" lookup capability used in the command "nmbd -L
  45. +'*'" was only added in 1.9.14. If you have 1.9.13 then use a clients
  46. +netbios name instead (for example "nmbd -L ACLIENT").
  47.  
  48. diff -u -r --new-file last-version/docs/INSTALL.txt samba-1.9.14alpha9/docs/INSTALL.txt
  49. --- last-version/docs/INSTALL.txt    Fri Jun 30 12:18:47 1995
  50. +++ samba-1.9.14alpha9/docs/INSTALL.txt    Fri Jul  7 08:30:27 1995
  51. @@ -258,6 +258,13 @@
  52.  The best solution is, however, to fix the nmbd setup. Experimentation
  53.  and careful reading of the Samba docs should help.
  54.  
  55. +SCOPE IDs
  56. +=========
  57. +
  58. +By default Samba uses a blank scope ID. This means all your windows
  59. +boxes must also have a blank scope ID. If you really want to use a
  60. +non-blank scope ID then you will need to use the -i <scope> option to
  61. +nmbd, smbd, and smbclient.
  62.  
  63.  CHOOSING THE PROTOCOL LEVEL
  64.  ===========================
  65. Only in last-version/docs: PASSWORDS.txt
  66. diff -u -r --new-file last-version/docs/Passwords.txt samba-1.9.14alpha9/docs/Passwords.txt
  67. --- last-version/docs/Passwords.txt    Thu Jan  1 10:00:00 1970
  68. +++ samba-1.9.14alpha9/docs/Passwords.txt    Fri Jun 30 12:06:06 1995
  69. @@ -0,0 +1,42 @@
  70. +NOTE ABOUT PASSWORDS
  71. +====================
  72. +
  73. +Unix systems use a wide variety of methods for checking the validity
  74. +of a password. This is primarily controlled with the Makefile defines
  75. +mentioned in the Makefile.
  76. +
  77. +Also note that some clients (notably WfWg) uppercase the password
  78. +before sending it. The server tries the password as it receives it and
  79. +also after lowercasing it.
  80. +
  81. +The Samba server can also be configured to try different
  82. +upper/lowercase combinations. This is controlled by the [global]
  83. +parameter "password level". A level of N means to try all combinations
  84. +up to N uppercase characters in the password. A high value can chew a
  85. +fair bit of CPU time and can lower the security of your system. Do not
  86. +use this options unless you really need it - the time taken for
  87. +password checking can become so high that clients time out. 
  88. +
  89. +If you do use the "password level" option then you might like to use
  90. +-DUFC_CRYPT in your Makefile. On some machine this makes password
  91. +checking _much_ faster. This is also useful if you use the @group
  92. +syntax in the user= option.
  93. +
  94. +If your site uses AFS (the Andrew File System), you can use the AFS section
  95. +in the Makefile.  This will first attempt to authenticate a username and
  96. +password to AFS.  If that succeeds, then the associated AFS rights will be
  97. +granted.  Otherwise, the password checking routine falls back to whatever
  98. +Unix password checking method you are using.  Note that the AFS code is
  99. +only written and tested for AFS 3.3 and later.
  100. +
  101. +
  102. +SECURITY = SERVER
  103. +=================
  104. +
  105. +Samba can use a remote server to do it's username/password
  106. +validation. This allows you to have one central machine (for example a
  107. +NT box) control the passwords for the Unix box.
  108. +
  109. +See the section on "security =" in smb.conf(5) for details.
  110. +
  111. +
  112. Only in last-version/docs: SPEED.txt
  113. Only in last-version/docs: SUPPORT.txt
  114. diff -u -r --new-file last-version/docs/Speed.txt samba-1.9.14alpha9/docs/Speed.txt
  115. --- last-version/docs/Speed.txt    Thu Jan  1 10:00:00 1970
  116. +++ samba-1.9.14alpha9/docs/Speed.txt    Mon Jul  3 18:37:33 1995
  117. @@ -0,0 +1,260 @@
  118. +This file tries to outline the ways to improve the speed of a Samba server.
  119. +
  120. +Andrew Tridgell
  121. +January 1995
  122. +
  123. +
  124. +COMPARISONS
  125. +-----------
  126. +
  127. +The Samba server uses TCP to talk to the client. Thus if you are
  128. +trying to see if it performs well you should really compare it to
  129. +programs that use the same protocol. The most readily available
  130. +programs for file transfer that use TCP are ftp or another TCP based
  131. +SMB server.
  132. +
  133. +If you want to test against something like a NT or WfWg server then
  134. +you will have to disable all but TCP on either the client or
  135. +server. Otherwise you may well be using a totally different protocol
  136. +(such as Netbeui) and comparisons may not be valid.
  137. +
  138. +Generally you should find that Samba performs similarly to ftp at raw
  139. +transfer speed. It should perform quite a bit faster than NFS,
  140. +although this very much depends on your system.
  141. +
  142. +Several people have done comparisons between Samba and Novell, NFS or
  143. +WinNT. In some cases Samba performed the best, in others the worst. I
  144. +suspect the biggest factor is not Samba vs some other system but the
  145. +hardware and drivers used on the various systems. Given similar
  146. +hardware Samba should certainly be competitive in speed with other
  147. +systems.
  148. +
  149. +
  150. +SOCKET OPTIONS
  151. +--------------
  152. +
  153. +There are a number of socket options that can greatly affect the
  154. +performance of a TCP based server like Samba.
  155. +
  156. +The socket options that Samba uses are settable both on the command
  157. +line with the -O option, or in the smb.conf file.
  158. +
  159. +The "socket options" section of the smb.conf manual page describes how
  160. +to set these and gives recommendations.
  161. +
  162. +Getting the socket options right can make a big difference to your
  163. +performance, but getting them wrong can degrade it by just as
  164. +much. The correct settings are very dependent on your local network.
  165. +
  166. +The socket option TCP_NODELAY is the one that seems to make the
  167. +biggest single difference for most networks. Many people report that
  168. +adding "socket options = TCP_NODELAY" doubles the read performance of
  169. +a Samba drive. The best explanation I have seen for this is that the
  170. +Microsoft TCP/IP stack is slow in sending tcp ACKs.
  171. +
  172. +
  173. +READ SIZE
  174. +---------
  175. +
  176. +The option "read size" affects the overlap of disk reads/writes with
  177. +network reads/writes. If the amount of data being transferred in
  178. +several of the SMB commands (currently SMBwrite, SMBwriteX and
  179. +SMBreadbraw) is larger than this value then the server begins writing
  180. +the data before it has received the whole packet from the network, or
  181. +in the case of SMBreadbraw, it begins writing to the network before
  182. +all the data has been read from disk.
  183. +
  184. +This overlapping works best when the speeds of disk and network access
  185. +are similar, having very little effect when the speed of one is much
  186. +greater than the other.
  187. +
  188. +The default value is 16384, but very little experimentation has been
  189. +done yet to determine the optimal value, and it is likely that the best
  190. +value will vary greatly between systems anyway. A value over 65536 is
  191. +pointless and will cause you to allocate memory unnecessarily.
  192. +
  193. +
  194. +MAX XMIT
  195. +--------
  196. +
  197. +At startup the client and server negotiate a "maximum transmit" size,
  198. +which limits the size of nearly all SMB commands. You can set the
  199. +maximum size that Samba will negotiate using the "max xmit = " option
  200. +in smb.conf.
  201. +
  202. +It defaults to 65536 bytes (the maximum), but it is possible that some
  203. +clients may perform better with a smaller transmit unit. Trying values
  204. +of less than 2048 is likely to cause severe problems.
  205. +
  206. +In most cases the default is the best option.
  207. +
  208. +
  209. +LOCKING
  210. +-------
  211. +
  212. +By default Samba does not implement strict locking on each read/write
  213. +call (although it did in previous versions). If you enable strict
  214. +locking (using "strict locking = yes") then you may find that you
  215. +suffer a severe performance hit on some systems.
  216. +
  217. +The performance hit will probably be greater on NFS mounted
  218. +filesystems, but could be quite high even on local disks.
  219. +
  220. +
  221. +LOG LEVEL
  222. +---------
  223. +
  224. +If you set the log level (also known as "debug level") higher than 2
  225. +then you may suffer a large drop in performance. This is because the
  226. +server flushes the log file after each operation, which can be very
  227. +expensive. 
  228. +
  229. +
  230. +WIDE LINKS
  231. +----------
  232. +
  233. +The "wide links" option is now enabled by default, but if you disable
  234. +it (for better security) then you may suffer a performance hit in
  235. +resolving filenames. The performance loss is lessened if you have
  236. +"getwd cache = yes", which is now the default.
  237. +
  238. +
  239. +READ RAW
  240. +--------
  241. +
  242. +The "read raw" operation is designed to be an optimised, low-latency
  243. +file read operation. A server may choose to not support it,
  244. +however. and Samba makes support for "read raw" optional, with it
  245. +being enabled by default.
  246. +
  247. +In some cases clients don't handle "read raw" very well and actually
  248. +get lower performance using it than they get using the conventional
  249. +read operations. 
  250. +
  251. +So you might like to try "read raw = no" and see what happens on your
  252. +network. It might lower, raise or not affect your performance. Only
  253. +testing can really tell.
  254. +
  255. +
  256. +WRITE RAW
  257. +---------
  258. +
  259. +The "write raw" operation is designed to be an optimised, low-latency
  260. +file write operation. A server may choose to not support it,
  261. +however. and Samba makes support for "write raw" optional, with it
  262. +being enabled by default.
  263. +
  264. +Some machines may find "write raw" slower than normal write, in which
  265. +case you may wish to change this option.
  266. +
  267. +READ PREDICTION
  268. +---------------
  269. +
  270. +Samba can do read prediction on some of the SMB commands. Read
  271. +prediction means that Samba reads some extra data on the last file it
  272. +read while waiting for the next SMB command to arrive. It can then
  273. +respond more quickly when the next read request arrives.
  274. +
  275. +This is disabled by default. You can enable it by using "read
  276. +prediction = yes".
  277. +
  278. +Note that read prediction is only used on files that were opened read
  279. +only.
  280. +
  281. +Read prediction should particularly help for those silly clients (such
  282. +as "Write" under NT) which do lots of very small reads on a file.
  283. +
  284. +Samba will not read ahead more data than the amount specified in the
  285. +"read size" option. It always reads ahead on 1k block boundaries.
  286. +
  287. +
  288. +MEMORY MAPPING
  289. +--------------
  290. +
  291. +Samba supports reading files via memory mapping them. One some
  292. +machines this can give a large boost to performance, on others it
  293. +makes not difference at all, and on some it may reduce performance.
  294. +
  295. +To enable you you have to recompile Samba with the -DUSE_MMAP=1 option
  296. +on the FLAGS line of the Makefile.
  297. +
  298. +Note that memory mapping is only used on files opened read only, and
  299. +is not used by the "read raw" operation. Thus you may find memory
  300. +mapping is more effective if you disable "read raw" using "read raw =
  301. +no".
  302. +
  303. +
  304. +SLOW CLIENTS
  305. +------------
  306. +
  307. +One person has reported that setting the protocol to COREPLUS rather
  308. +than LANMAN2 gave a dramatic speed improvement (from 10k/s to 150k/s).
  309. +
  310. +I suspect that his PC's (386sx16 based) were asking for more data than
  311. +they could chew. I suspect a similar speed could be had by setting
  312. +"read raw = no" and "max xmit = 2048", instead of changing the
  313. +protocol. Lowering the "read size" might also help.
  314. +
  315. +
  316. +SLOW LOGINS
  317. +-----------
  318. +
  319. +Slow logins are almost always due to the password checking time. Using
  320. +the lowest practical "password level" will improve things a lot. You
  321. +could also enable the "UFC crypt" option in the Makefile.
  322. +
  323. +CLIENT TUNING
  324. +-------------
  325. +
  326. +Often a speed problem can be traced to the client. The client (for
  327. +example Windows for Workgroups) can often be tuned for better TCP
  328. +performance.
  329. +
  330. +See your client docs for details. In particular, I have heard rumours
  331. +that the WfWg options TCPWINDOWSIZE and TCPSEGMENTSIZE can have a
  332. +large impact on performance.
  333. +
  334. +Also note that some people have found that setting DefaultRcvWindow in
  335. +the [MSTCP] section of the SYSTEM.INI file under WfWg to 3072 gives a
  336. +big improvement. I don't know why.
  337. +
  338. +My own experience wth DefaultRcvWindow is that I get much better
  339. +performance with a large value (16384 or larger). Other people have
  340. +reported that anything over 3072 slows things down enourmously. One
  341. +person even reported a speed drop of a factor of 30 when he went from
  342. +3072 to 8192. I don't know why.
  343. +
  344. +It probably depends a lot on your hardware, and the type of unix box
  345. +you have at the other end of the link.
  346. +
  347. +MY RESULTS
  348. +----------
  349. +
  350. +Some people want to see real numbers in a document like this, so here
  351. +they are. I have a 486sx33 client running WfWg 3.11 with the 3.11b
  352. +tcp/ip stack. It has a slow IDE drive and 20Mb of ram. It has a SMC
  353. +Elite-16 ISA bus ethernet card. The only WfWg tuning I've done is to
  354. +set DefaultRcvWindow in the [MSTCP] section of system.ini to 16384. My
  355. +server is a 486dx3-66 running Linux. It also has 20Mb of ram and a SMC
  356. +Elite-16 card. You can see my server config in the examples/tridge/
  357. +subdirectory of the distribution.
  358. +
  359. +I get 490k/s on reading a 8Mb file with copy.
  360. +I get 441k/s writing the same file to the samba server.
  361. +
  362. +Of course, there's a lot more to benchmarks than 2 raw throughput
  363. +figures, but it gives you a ballpark figure.
  364. +
  365. +I've also tested Win95 and WinNT, and found WinNT gave me the best
  366. +speed as a samba client. The fastest client of all (for me) is
  367. +smbclient running on another linux box. Maybe I'll add those results
  368. +here someday ...
  369. +
  370. +
  371. +COMMENTS
  372. +--------
  373. +
  374. +If you've read this far then please give me some feedback! Which of
  375. +the above suggestions worked for you?
  376. +
  377. +Mail the samba mailing list or Andrew.Tridgell@anu.edu.au
  378. diff -u -r --new-file last-version/docs/Support.txt samba-1.9.14alpha9/docs/Support.txt
  379. --- last-version/docs/Support.txt    Thu Jan  1 10:00:00 1970
  380. +++ samba-1.9.14alpha9/docs/Support.txt    Fri Jun 23 19:52:09 1995
  381. @@ -0,0 +1,190 @@
  382. +The Samba Consultants List
  383. +==========================
  384. +
  385. +I often get asked about paid support for Samba. I don't have the
  386. +time/inclination to do this myself at the moment, so I decided to
  387. +compile a list of people who are prepared to install/support Samba.
  388. +
  389. +Being on this list does not imply any sort of endorsement, I just
  390. +provide this list in the hope that it will be useful.
  391. +
  392. +If you want to be added to the list, or want your entry modified then
  393. +contact me at the address below. I am currently listing them in the
  394. +order that I have received them. If it gets too big I may organise it
  395. +by region.
  396. +
  397. +Andrew.Tridgell@anu.edu.au
  398. +
  399. +
  400. +
  401. +------------------------------------------------------------------------------
  402. +BRISBANE - AUSTRALIA
  403. +
  404. +Brett Worth
  405. +Select Computer Technology - Brisbane
  406. +431 Logan Road
  407. +Stones Corner   QLD   4120
  408. +E-Mail: brett@sct.com.au
  409. +------------------------------------------------------------------------------
  410. +
  411. +------------------------------------------------------------------------------
  412. +CANBERRA - AUSTRALIA
  413. +
  414. +Paul Blackman (ictinus@lake.canberra.edu.au, Ph. 06 2012518) is
  415. +available for consultation.  Paul's Samba background is with
  416. +Solaris 2.3/4 and WFWG/Win95 machines.  Paul is also the maintainer
  417. +of the SAMBA Web Pages.
  418. +------------------------------------------------------------------------------
  419. +
  420. +------------------------------------------------------------------------------
  421. +READING - ENGLAND
  422. +
  423. +Philip Hands                  |   E-Mail: info@hands.com
  424. +Philip Hands Computing Ltd.   |   Tel: +44 1734 476287 Fax: 1734 474655
  425. +Unit 1, Cherry Close, Caversham, Reading RG4 8UP  UK
  426. +
  427. +Samba experience:  SVR4,SVR3.2 & Linux <--> WfWg, W3.1, OS2 and MS-LanMan
  428. +------------------------------------------------------------------------------
  429. +
  430. +------------------------------------------------------------------------------
  431. +Information One, Inc.
  432. +736 Hinman Ave, Suite 2W
  433. +Evanston, IL 60202
  434. +708-328-9137  708-328-0117 FAX  
  435. +info@info1.com
  436. +
  437. +Providing custom Internet and networking solutions.
  438. +------------------------------------------------------------------------------
  439. +
  440. +------------------------------------------------------------------------------
  441. +Olympic Peninsula Consulting; 1241 Lansing Ave W., Bremerton, WA 98312-4343
  442. +telephone 1+ 360 792 6938; mailto:opc@aa.net; http://www.aa.net/~opc;
  443. +Unix Systems and TCP/IP Network design, programming, and administration.
  444. +------------------------------------------------------------------------------
  445. +
  446. +------------------------------------------------------------------------------
  447. +SolutionS R Us has been in business for 3+ years providing viable 3rd
  448. +party support in system/network administration. With our own Linux
  449. +distribution which we're constantly improving to make it the best and
  450. +using it to provide total solutions for companies which are open to
  451. +using Linux.
  452. +
  453. +Mauro DePalma  <mauro@sru.com>
  454. +------------------------------------------------------------------------------
  455. +
  456. +------------------------------------------------------------------------------
  457. +BIELEFELD - GERMANY
  458. +
  459. +I am located in Bielefeld/Germany and have been doing Unix consultancy
  460. +work for the past 8 years throughout Germany and the rest of Europe. I
  461. +can be contacted by email at <jpm@mens.de> or via phone at +49 521
  462. +9225922 or telefax at +49 521 9225924.
  463. +------------------------------------------------------------------------------
  464. +
  465. +------------------------------------------------------------------------------
  466. +CANBERRA - AUSTRALIA
  467. +
  468. +Ben Elliston
  469. +Faculty of Information Sciences and Engineering
  470. +University of Canberra AUSTRALIA
  471. +E-mail: ben@ise.canberra.edu.au (Uni)
  472. +------------------------------------------------------------------------------
  473. +
  474. +------------------------------------------------------------------------------
  475. +PALERMO - ITALY
  476. +
  477. +Francesco Cardinale
  478. +E-Mail: cardinal@palermo.italtel.it
  479. +Samba experience: SVR3.2, SOLARIS, ULTRIX, LINUX <--> DOS LAN-MAN, WFW
  480. +------------------------------------------------------------------------------
  481. +
  482. +------------------------------------------------------------------------------
  483. +SYDNEY - AUSTRALIA
  484. +
  485. +John Terpstra - Aquasoft (jht@aquasoft.com.au)
  486. +Business:  +612 524 4040
  487. +Home:      +612 540 3154
  488. +Shoephone: +612 414 334422  (aka 0414 334422)
  489. +------------------------------------------------------------------------------
  490. +
  491. +------------------------------------------------------------------------------
  492. +ONTARIO - CANADA
  493. +
  494. +Strata Software Limited, Kanata Ontario CANADA
  495. +Tel:   +1 (613) 591-1922   Fax:   +1 (613) 591-3485
  496. +Email: sales@strataware.com   WWW: http://www.strataware.com/
  497. +
  498. +Strata Software Limited is a software development and consulting group
  499. +specializing in data communications (TCP/IP and OSI), X.400, X.500 and
  500. +LDAP, and X.509-based security.  We have Samba experience with Windows NT,
  501. +Windows 95, and Windows for Workgroups clients with Linux, Unixware
  502. +(SVR4), and HP-UX servers.
  503. +------------------------------------------------------------------------------
  504. +
  505. +-----------------------------------------------------------------------
  506. +SYDNEY - AUSTRALIA
  507. +
  508. +We are a Unix & Windows developer with a consulting & support component.
  509. +In business since 1981 with experience on Sun, hp, sgi, IBM rs6000 plus
  510. +Windows, NT and Win95,  Using Samba since September 94.
  511. +CodeSmiths,  22 Darley Road, MANLY 2095  NSW;  977 1979; fax: 977 2116
  512. +philm@esi.com.au   (Australia; New South Wales; SYDNEY; North East)
  513. +-----------------------------------------------------------------------
  514. +
  515. +------------------------------------------------------------------------------
  516. +EDINBUGH - SCOTLAND
  517. +
  518. +Charlie Hussey                            email charlie@edina.demon.co.uk
  519. +Edina Software Limited                    tel   0131 657 1129
  520. +4 James Street                            fax   0131 669 9092
  521. +Edinburgh EH15 2DS
  522. +
  523. +SAMBA experience: SCO UNIX  <=> WfWg
  524. +------------------------------------------------------------------------------
  525. +
  526. +------------------------------------------------------------------------------
  527. +LONDON - ENGLAND
  528. +
  529. +Mark H. Preston,
  530. +Network Analyst,                    | Email : mpreston@sghms.ac.uk
  531. +Computer Unit,                      | Tel   : +44 (0)181 725-5434
  532. +St. George's Hospital Med School,   | Fax   : +44 (0)181 725-3583
  533. +London SW17 ORE.                    | WWW   : http://www.sghms.ac.uk
  534. +
  535. +Samba Experience:
  536. +Server: Solaris 2.3 & 2.4, Irix 5.2 & 5.3
  537. +Client: WinNT, Win95, WfWg, Win3.1, Ms-LanMan, DHCP support
  538. +------------------------------------------------------------------------------
  539. +
  540. +------------------------------------------------------------------------------
  541. +SYDNEY - AUSTRALIA
  542. +
  543. +Pacific ESI has used and installed Samba since 1.6 on a range
  544. +of machines running SunOS, BSD/OS, SCO/UNIX, HP/UX, and Solaris,
  545. +and WfWG and Windows95.  The largest system worked on to date
  546. +involved an Australia wide network of machines with PCs and SUNs
  547. +at the various nodes.  The in-house testing site is a wide area
  548. +network with three sites, remotely connected with PPP and with
  549. +SUN servers at each site to all of which are connected several
  550. +PCs running mainly WfWG.
  551. +
  552. +Stefan Kjellberg                Pacific Engineering Systems
  553. +International
  554. +info@eram.esi.com.au            Voice:+61-2-9063377
  555. +... Fax:+61-2-9063468
  556. +------------------------------------------------------------------------------
  557. +
  558. +------------------------------------------------------------------------------
  559. +CHANTILLY - USA
  560. +
  561. +Intelligent Decisions, Inc.
  562. +ATTN: Richard Bullington
  563. +14121 Parke Long Ct. #104
  564. +Chantilly, VA 22021
  565. +U.S.A.
  566. +(703) 803-8070
  567. +rbullington@intdec.com
  568. +
  569. +Samba experience: Linux, DEC ULTRIX <=> WFWG 3.11, Windows NT 3.5
  570. +Specializing in World Wide Web related UNIX-to-PC connectivity.
  571. +------------------------------------------------------------------------------
  572. Only in last-version/docs: WARP.txt
  573. Only in last-version/docs: WINNT.txt
  574. diff -u -r --new-file last-version/docs/Warp.txt samba-1.9.14alpha9/docs/Warp.txt
  575. --- last-version/docs/Warp.txt    Thu Jan  1 10:00:00 1970
  576. +++ samba-1.9.14alpha9/docs/Warp.txt    Sun Mar 26 10:25:55 1995
  577. @@ -0,0 +1,99 @@
  578. +Here is some advice from maxfield@ctelcom.uucp.netcom.com (Wade Maxfie
  579. +to use Samba with OS/2 Warp.
  580. +
  581. +Note that you may also find ftp://ftp.cdrom.com/pub/os2/new/os2net.faq
  582. +useful.
  583. +
  584. +
  585. +
  586. +        Can I use Samba with Warp?
  587. +
  588. +        Yes.  The MSClient software at ftp.microsoft.com in the Bussys
  589. +(lanman os2 directory) will work, sort of.  It is version 2.2c.
  590. +
  591. +        First, uncloack os2ver.  (attrib -h -r -s c:\os2ver).  It is a
  592. +text file.  change netwksta.xxx to 20=netwksta.sys.  Also add
  593. +20=setup.exe.  Another change will be needed, a .vdd file.  I remember
  594. +it came up during the installation as being a wrong version.  I wrote
  595. +the name down, changed os2ver to include it, and restarted the
  596. +installation.
  597. +
  598. + Here is a copy of my os2ver
  599. +
  600. +setup.exe
  601. +netbios.os2
  602. +nwifs.ifs
  603. +netwksta.sys
  604. +nwreq.sys
  605. +netbios.sys
  606. +ipx.sys
  607. +netvdd.sys
  608. +
  609. +Re-cloak os2ver. (attrib +h +r +s c:\os2ver)
  610. +
  611. +Run the installation from an OS/2 Box.  Note that your mouse wont work,
  612. +use the TAB key to move around, enter to select hilighted items.
  613. +
  614. +Here is a copy of my Config.sys file regarding the Laman entries.
  615. +Note even though the version is 2.2c, it reports 2.2a in the text.
  616. +
  617. +REM ==== LANMAN 2.2a == DO NOT MODIFY BETWEEN THESE LINES == LANMAN 2.
  618. +DEVICE=C:\LANMAN\DRIVERS\PROTMAN\PROTMAN.OS2 /i:C:\LANMAN
  619. +DEVICE=C:\LANMAN\DRIVERS\ETHERNET\Ns2000\Ns2000.OS2
  620. +RUN=C:\LANMAN\DRIVERS\PROTOCOL\tcpip\starttcp.exe
  621. +RUN=C:\LANMAN\DRIVERS\PROTOCOL\tcpip\startnb.exe
  622. +DEVICE=C:\LANMAN\DRIVERS\PROTOCOL\tcpip\tcpdrv.os2
  623. +DEVICE=C:\LANMAN\DRIVERS\PROTOCOL\tcpip\nbdrv.os2
  624. +DEVICE=C:\LANMAN\DRIVERS\PROTOCOL\tcpip\nmdrv.os2
  625. +DEVICE=C:\LANMAN\arpa\sockdrv.os2
  626. +DEVICE=C:\LANMAN\DRIVERS\PROTOCOL\NETBEUI\NETBEUI.OS2
  627. +DEVICE=C:\LANMAN\NETPROG\RDRHELP.SYS
  628. +IFS=C:\LANMAN\NETPROG\NETWKSTA.SYS /i:C:\LANMAN
  629. +DEVICE=C:\LANMAN\NETPROG\NETVDD.SYS
  630. +REM ==== LANMAN 2.2a == DO NOT MODIFY BETWEEN THESE LINES == LANMAN 2.
  631. +
  632. +
  633. +       If you have an NE2000 card, don't reboot, or you'll be sorry.
  634. +enable the automatic backup mechanism for recovering old config.sys and
  635. +other files in OS/2.  It paid for itself during this installation nightm
  636. +before I knew better!)
  637. +
  638. +        Next, (or perhaps before this), if you have an NE2000 adaptor,
  639. +get the ns2000 files from hobbes.nmsu.edu (in ns2000.zip).  I manually
  640. +patched protocol.ini to refer to that adaptor, and copied it into my
  641. +c:\lanman directory.  Note that I also modified the driver to be loaded
  642. +in the config.sys to the ns2000.os2.  It might install as an "other"
  643. +adaptor.
  644. +
  645. +      A command file "startup.cmd" is placed in c:\.  This file is
  646. +automatically run when OS/2 Warp starts.
  647. +Here is a copy of my startup file.  Note that Warp sometimes fails to
  648. +login properly to the server.  I solve this by checking for the
  649. +existance of a file, and rerunning the loing if that file fails to
  650. +exist.
  651. +
  652. +@REM ==== LANMAN 2.2a == DO NOT MODIFY BETWEEN THESE LINES == LANMAN
  653. +NET START WORKSTATION
  654. +:relogin
  655. +NET LOGON maxfield mypassword /y
  656. +rem net use f: \\packard90\d$
  657. +rem net use g: \\linuxone\cdromsdir
  658. +rem net use h: \\linuxone\public
  659. +:doOver
  660. +if not exist f:\wildcat\wildcat.exe goto relogin
  661. +@REM ==== LANMAN 2.2a == DO NOT MODIFY BETWEEN THESE LINES == LANMAN
  662. +exit
  663. +
  664. +        Finally, the system expects to be on a domain with a domain
  665. +server.  BTW, TCP/IP and NetBeui allow simultaneous communication with
  666. +Os/2 lanserver 4.0, and Samba.  (Note: Lanserver 4.0 won't yet to
  667. +TCP/IP.  (Well,it might, but it crashes before I get to that point, so I
  668. +havent' been able to enable it))
  669. +
  670. +I have not yet tried with only a SAMBA server on the domain.
  671. +
  672. +    I would be glad to try to answer any questions at above e-mail
  673. +address, if I can.
  674. +
  675. +wade
  676. +
  677. diff -u -r --new-file last-version/docs/WinNT.txt samba-1.9.14alpha9/docs/WinNT.txt
  678. --- last-version/docs/WinNT.txt    Thu Jan  1 10:00:00 1970
  679. +++ samba-1.9.14alpha9/docs/WinNT.txt    Sun Jul  9 14:37:55 1995
  680. @@ -0,0 +1,56 @@
  681. +There are some particular issues with Samba and Windows NT
  682. +
  683. +=====================================================================
  684. +One of the most annoying problems with WinNT is that NT refuses to
  685. +connect to a server that is in user level security mode and that
  686. +doesn't support password encryption unless it first prompts the user
  687. +for a password.
  688. +
  689. +This means even if you have the same password on the NT box and the
  690. +Samba server you will get prompted for a password. Entering the
  691. +correct password will get you connected.
  692. +
  693. +The other major ramification of this feature of NT is that it can't
  694. +browse a user level non-encrypted server unless it already has a
  695. +connection open. This is because there is no spot for a password
  696. +prompt in the browser window. It works fine if you already have a
  697. +drive mounted (for example, one auto mounted on startup).
  698. +
  699. +Samba should support encrypted passwords soon, which will solve this
  700. +problem.
  701. +=====================================================================
  702. +
  703. +
  704. +
  705. +=====================================================================
  706. +When you mount a printer using the print manager in NT you may find
  707. +the following info from Matthew Harrell <harrell@leech.nrl.navy.mil>
  708. +useful:
  709. +
  710. +------------
  711. +        I noticed in your change-log you noted that some people were
  712. +still unable to use print manager under NT.  If this is the same problem
  713. +that I encountered, it's caused by the length of time it takes NT to
  714. +determine if the printer is ready.
  715. +
  716. +The problem occurs when you double-click on a printer to connect it to
  717. +the NT machine.  Because it's unable to determine if the printer is ready
  718. +in the short span of time it has, it assumes it isn't and gives some
  719. +strange error about not having enough resources (I forget what the error
  720. +is).  A solution to this that seems to work fine for us is to click
  721. +once on the printer, look at the bottom of the window and wait until
  722. +it says it's ready, then clilck on "OK".
  723. +
  724. +By the way, this problem probably occurs in our group because the
  725. +Samba server doesn't actually have the printers - it queues them to
  726. +remote printers either on other machines or using their own network
  727. +cards.  Because of this "middle layer", it takes an extra amount of
  728. +time for the NT machine to get verification that the printer queue
  729. +actually exists.
  730. +
  731. +I hope this helped in some way...
  732. +-----------
  733. +=====================================================================
  734. +
  735. +
  736. +
  737. diff -u -r --new-file last-version/source/Makefile samba-1.9.14alpha9/source/Makefile
  738. --- last-version/source/Makefile    Thu Jul  6 17:31:25 1995
  739. +++ samba-1.9.14alpha9/source/Makefile    Sun Jul  9 15:29:01 1995
  740. @@ -71,8 +71,9 @@
  741.  # AFS_BASE = /usr/afsws
  742.  # AFS_FLAGS = -DAFS_AUTH -I$(AFS_BASE)/include
  743.  # AFS_LIBDIR = $(AFS_BASE)/lib
  744. +# NOTE: You may need to add -laudit in the line below
  745.  # AFS_LIBS = -L$(AFS_LIBDIR) -L$(AFS_LIBDIR)/afs -lkauth -lprot -lubik \
  746. -#                -lauth -lrxkad -lsys -ldes -lrx -llwp -lcom_err -laudit \
  747. +#                -lauth -lrxkad -lsys -ldes -lrx -llwp -lcom_err \
  748.  #                $(AFS_LIBDIR)/afs/util.a
  749.  
  750.  # This is for DCE/DFS enablement. Uncomment this so that smbd can
  751. @@ -413,9 +414,9 @@
  752.  INCLUDES = $(INCLUDES1) $(INCLUDES2)
  753.  
  754.  UTILOBJ = util.o charset.o kanji.o fault.o
  755. -PARAMOBJ = $(UTILOBJ) loadparm.o params.o pcap.o access.o password.o ufc.o 
  756. +PARAMOBJ = $(UTILOBJ) loadparm.o params.o pcap.o access.o username.o ufc.o 
  757.  SMBDOBJ1 = $(PARAMOBJ) trans2.o message.o dir.o printing.o locking.o
  758. -SMBDOBJ2 = ipc.o reply.o mangle.o chgpasswd.o 
  759. +SMBDOBJ2 = ipc.o reply.o mangle.o chgpasswd.o password.o
  760.  SMBDOBJ = $(SMBDOBJ1) $(SMBDOBJ2)
  761.  
  762.  .c.o: $*.c $(INCLUDES)
  763. diff -u -r --new-file last-version/source/access.c samba-1.9.14alpha9/source/access.c
  764. --- last-version/source/access.c    Fri Jun 30 17:22:49 1995
  765. +++ samba-1.9.14alpha9/source/access.c    Fri Jul  7 15:26:19 1995
  766. @@ -297,7 +297,7 @@
  767.  BOOL fromhost(int sock,struct from_host *f)
  768.  {
  769.      static struct sockaddr sa;
  770. -    struct sockaddr_in *sin = (struct sockaddr_in *) (&sa);
  771. +    struct sockaddr_in *sockin = (struct sockaddr_in *) (&sa);
  772.      struct hostent *hp;
  773.      int     length = sizeof(sa);
  774.      static char addr_buf[FROM_ADDRLEN];
  775. @@ -310,12 +310,12 @@
  776.      return(False);
  777.        }
  778.  
  779. -    f->sin = sin;
  780. -    f->addr = strcpy(addr_buf,(char *)inet_ntoa(sin->sin_addr));
  781. +    f->sin = sockin;
  782. +    f->addr = strcpy(addr_buf,(char *)inet_ntoa(sockin->sin_addr));
  783.  
  784.      /* Look up the remote host name. */
  785. -    if ((hp = gethostbyaddr((char *) &sin->sin_addr,
  786. -                sizeof(sin->sin_addr),
  787. +    if ((hp = gethostbyaddr((char *) &sockin->sin_addr,
  788. +                sizeof(sockin->sin_addr),
  789.                  AF_INET)) == 0) {
  790.        DEBUG(0,("Gethostbyaddr failed\n"));
  791.  #ifdef ALLOW_PURE_ADDRESSES
  792. @@ -327,14 +327,14 @@
  793.  
  794.      /* Save the host name. A later gethostbyxxx() call may clobber it. */
  795.      f->name = StrnCpy(name_buf,
  796. -                      takeAddressAsHostname? f->addr : (char *)hp->h_name,
  797. +                      takeAddressAsHostname? f->addr : hp->h_name,
  798.                        sizeof(name_buf) - 1);
  799.  
  800.      /*
  801.       * Verify that the host name does not belong to someone else. If host
  802.       * name verification fails, pretend that the host name lookup failed.
  803.       */
  804. -    if (!takeAddressAsHostname && !matchname(f->name, sin->sin_addr))
  805. +    if (!takeAddressAsHostname && !matchname(f->name, sockin->sin_addr))
  806.        {
  807.      DEBUG(0,("Matchname failed\n"));
  808.      return(False);
  809. diff -u -r --new-file last-version/source/change-log samba-1.9.14alpha9/source/change-log
  810. --- last-version/source/change-log    Thu Jul  6 18:08:50 1995
  811. +++ samba-1.9.14alpha9/source/change-log    Sun Jul  9 16:27:09 1995
  812. @@ -1508,7 +1508,12 @@
  813.      - convex and other patches from Ulrich Hahn
  814.      <ulrich.hahn@zdv.uni-tuebingen.de>
  815.      - released alpha8
  816. -    
  817. +    - fixed rename directory bug
  818. +    - nmbd wins fix from Maximilian Errath <errath@balu.kfunigraz.ac.at>
  819. +    - client and AFS changes + password.c reorganisation + "more" and
  820. +    "pwd" commands in client from Todd j. Derr (tjd@smi.med.pitt.edu)
  821. +    - fixed several nmbd bugs
  822. +
  823.  
  824.  ==========
  825.  todo:
  826. diff -u -r --new-file last-version/source/client.c samba-1.9.14alpha9/source/client.c
  827. --- last-version/source/client.c    Thu Jul  6 17:20:27 1995
  828. +++ samba-1.9.14alpha9/source/client.c    Sun Jul  9 15:26:37 1995
  829. @@ -384,11 +384,19 @@
  830.      SVAL(inbuf,smb_vwv3)));
  831.  }
  832.  
  833. +/****************************************************************************
  834. +show cd/pwd
  835. +****************************************************************************/
  836. +static void cmd_pwd(void)
  837. +{
  838. +  DEBUG(0,("Current directory is %s%s\n",CNV_LANG(service),CNV_LANG(cur_dir)));
  839. +}
  840. +
  841.  
  842.  /****************************************************************************
  843.  change directory
  844.  ****************************************************************************/
  845. -static void cmd_cd(char *inbuf,char *outbuf )
  846. +static void cmd_cd(char *inbuf,char *outbuf)
  847.  {
  848.    fstring buf;
  849.    char *p = buf;
  850. @@ -424,8 +432,8 @@
  851.  
  852.  
  853.  /****************************************************************************
  854. -display info about a file
  855. -****************************************************************************/
  856. +  display info about a file
  857. +  ****************************************************************************/
  858.  static void display_finfo(file_info *finfo)
  859.  {
  860.    time_t t = finfo->mtime - DSTDiff(finfo->mtime);
  861. @@ -437,8 +445,8 @@
  862.  }
  863.  
  864.  /****************************************************************************
  865. -do a directory listing, calling fn on each file found
  866. -****************************************************************************/
  867. +  do a directory listing, calling fn on each file found
  868. +  ****************************************************************************/
  869.  void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(),BOOL recurse_dir)
  870.  {
  871.    if (Protocol >= PROTOCOL_LANMAN2)
  872. @@ -453,8 +461,8 @@
  873.  }
  874.  
  875.  /*******************************************************************
  876. -decide if a file should be operated on
  877. -********************************************************************/
  878. +  decide if a file should be operated on
  879. +  ********************************************************************/
  880.  static BOOL do_this_one(file_info *finfo)
  881.  {
  882.    if (finfo->mode & aDIR) return(True);
  883. @@ -470,8 +478,8 @@
  884.  
  885.  
  886.  /****************************************************************************
  887. -act on the files in a dir listing
  888. -****************************************************************************/
  889. +  act on the files in a dir listing
  890. +  ****************************************************************************/
  891.  static void dir_action(char *inbuf,char *outbuf,int attribute,file_info *finfo,BOOL recurse_dir,void (*fn)(),BOOL longdir)
  892.  {
  893.  
  894. @@ -514,8 +522,8 @@
  895.  
  896.  
  897.  /****************************************************************************
  898. -do a directory listing, calling fn on each file found
  899. -****************************************************************************/
  900. +  do a directory listing, calling fn on each file found
  901. +  ****************************************************************************/
  902.  static int do_short_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(),BOOL recurse_dir)
  903.  {
  904.    char *p;
  905. @@ -651,10 +659,10 @@
  906.  }
  907.  
  908.  /****************************************************************************
  909. -receive a SMB trans2 response allocating the necessary memory
  910. -****************************************************************************/
  911. +  receive a SMB trans2 response allocating the necessary memory
  912. +  ****************************************************************************/
  913.  static BOOL receive_trans2_response(char *inbuf,int *data_len,int *param_len,
  914. -                 char **data,char **param)
  915. +                      char **data,char **param)
  916.  {
  917.    int total_data=0;
  918.    int total_param=0;
  919. @@ -696,9 +704,9 @@
  920.  }
  921.  
  922.  /****************************************************************************
  923. -do a directory listing, calling fn on each file found. Use the TRANSACT2
  924. -call for long filenames
  925. -****************************************************************************/
  926. +  do a directory listing, calling fn on each file found. Use the TRANSACT2
  927. +  call for long filenames
  928. +  ****************************************************************************/
  929.  static int do_long_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(),BOOL recurse_dir)
  930.  {
  931.    int max_matches = 512;
  932. @@ -759,14 +767,14 @@
  933.      SSVAL(outbuf,smb_setup0,TRANSACT2_FINDNEXT);
  934.  
  935.        p = smb_buf(outbuf);
  936. -      *p++ = 0; /* put in a null smb_name */
  937. -      *p++ = 'D'; *p++ = ' '; /* this was added because OS/2 does it */
  938. +      *p++ = 0;            /* put in a null smb_name */
  939. +      *p++ = 'D'; *p++ = ' ';    /* this was added because OS/2 does it */
  940.  
  941.        if (First)
  942.      {
  943.        SSVAL(p,0,attribute); /* attribute */
  944.        SSVAL(p,2,max_matches); /* max count */
  945. -      SSVAL(p,4,8+4+2); /* resume required + close on end + continue */
  946. +      SSVAL(p,4,8+4+2);    /* resume required + close on end + continue */
  947.        SSVAL(p,6,info_level); 
  948.        SIVAL(p,8,0);
  949.        p += 12;
  950. @@ -777,12 +785,12 @@
  951.        else
  952.      {
  953.        DEBUG(5,("hand=0x%X resume=%d ff_lastname=%d mask=%s\n",
  954. -        ff_dir_handle,ff_resume_key,ff_lastname,mask));
  955. +           ff_dir_handle,ff_resume_key,ff_lastname,mask));
  956.        SSVAL(p,0,ff_dir_handle);
  957.        SSVAL(p,2,max_matches); /* max count */
  958.        SSVAL(p,4,info_level); 
  959.        SIVAL(p,6,ff_resume_key); /* ff_resume_key */
  960. -      SSVAL(p,10,8+4+2); /* resume required + close on end + continue */
  961. +      SSVAL(p,10,8+4+2);    /* resume required + close on end + continue */
  962.        p += 12;
  963.        strcpy(p,mask);
  964.        *p++ = 0; *p++ = 0;
  965. @@ -850,7 +858,7 @@
  966.      }
  967.  
  968.        /* put in a length for the last entry, to ensure we can chain entries 
  969. -       into the next packet */
  970. +     into the next packet */
  971.        {
  972.      char *p2;
  973.      for (p2=p,i=0;i<(ff_searchcount-1);i++)
  974. @@ -868,7 +876,7 @@
  975.        if (resp_param) free(resp_param); resp_param = NULL;
  976.  
  977.        DEBUG(3,("received %d entries (eos=%d resume=%d)\n",
  978. -        ff_searchcount,ff_eos,ff_resume_key));
  979. +           ff_searchcount,ff_eos,ff_resume_key));
  980.  
  981.        First = False;
  982.      }
  983. @@ -893,8 +901,8 @@
  984.  
  985.  
  986.  /****************************************************************************
  987. -get a directory listing
  988. -****************************************************************************/
  989. +  get a directory listing
  990. +  ****************************************************************************/
  991.  static void cmd_dir(char *inbuf,char *outbuf)
  992.  {
  993.    int attribute = aDIR | aSYSTEM | aHIDDEN;
  994. @@ -931,8 +939,8 @@
  995.  
  996.  
  997.  /****************************************************************************
  998. -get a file from rname to lname
  999. -****************************************************************************/
  1000. +  get a file from rname to lname
  1001. +  ****************************************************************************/
  1002.  static void do_get(char *rname,char *lname,file_info *finfo1)
  1003.  {  
  1004.    int handle=0,fnum;
  1005. @@ -985,7 +993,7 @@
  1006.    strcpy(p,rname);
  1007.    p = skip_string(p,1);
  1008.  
  1009. -/* do a chained openX with a readX? */
  1010. +  /* do a chained openX with a readX? */
  1011.  #if 1
  1012.    if (finfo.size > 0)
  1013.      {
  1014. @@ -1001,19 +1009,19 @@
  1015.      }
  1016.  #endif
  1017.  
  1018. -      if(!strcmp(lname,"-"))
  1019. -    handle = fileno(stdout);
  1020. -      else 
  1021. -    {
  1022. -      handle = creat(lname,0644);
  1023. -      newhandle = True;
  1024. -    }
  1025. -      if (handle < 0)
  1026. -    {
  1027. -      DEBUG(0,("Error opening local file %s\n",lname));
  1028. -      free(inbuf);free(outbuf);
  1029. -      return;
  1030. -    }
  1031. +  if(!strcmp(lname,"-"))
  1032. +    handle = fileno(stdout);
  1033. +  else 
  1034. +    {
  1035. +      handle = creat(lname,0644);
  1036. +      newhandle = True;
  1037. +    }
  1038. +  if (handle < 0)
  1039. +    {
  1040. +      DEBUG(0,("Error opening local file %s\n",lname));
  1041. +      free(inbuf);free(outbuf);
  1042. +      return;
  1043. +    }
  1044.  
  1045.    send_smb(outbuf);
  1046.    receive_smb(inbuf,CLIENT_TIMEOUT);
  1047. @@ -1061,16 +1069,17 @@
  1048.      }
  1049.  
  1050.  
  1051. -    DEBUG(2,("getting file %s of size %d bytes as %s ",
  1052. -         CNV_LANG(finfo.name),
  1053. -         finfo.size,
  1054. -         lname));
  1055. +  DEBUG(2,("getting file %s of size %d bytes as %s ",
  1056. +       CNV_LANG(finfo.name),
  1057. +       finfo.size,
  1058. +       lname));
  1059.  
  1060.    while (nread < finfo.size && !close_done)
  1061.      {
  1062.        int method = -1;
  1063. -      char *p=NULL;
  1064.        static BOOL can_chain_close = True;
  1065. +
  1066. +      p=NULL;
  1067.        
  1068.        DEBUG(3,("nread=%d\n",nread));
  1069.  
  1070. @@ -1249,11 +1258,11 @@
  1071.        break;
  1072.      }
  1073.   
  1074. -    if (writefile(handle,dataptr,datalen) != datalen)
  1075. -      {
  1076. -        DEBUG(0,("Error writing local file\n"));
  1077. -        break;
  1078. -      }
  1079. +      if (writefile(handle,dataptr,datalen) != datalen)
  1080. +    {
  1081. +      DEBUG(0,("Error writing local file\n"));
  1082. +      break;
  1083. +    }
  1084.        
  1085.        nread += datalen;
  1086.        if (datalen == 0) 
  1087. @@ -1296,7 +1305,6 @@
  1088.      close(handle);
  1089.  
  1090.    if (archive_level >= 2 && (finfo.mode & aARCH)) {
  1091. -    char *p;
  1092.      bzero(outbuf,smb_size);
  1093.      set_message(outbuf,8,strlen(rname)+4,True);
  1094.      CVAL(outbuf,smb_com) = SMBsetatr;
  1095. @@ -1335,8 +1343,8 @@
  1096.  
  1097.  
  1098.  /****************************************************************************
  1099. -get a file
  1100. -****************************************************************************/
  1101. +  get a file
  1102. +  ****************************************************************************/
  1103.  static void cmd_get(void)
  1104.  {
  1105.    pstring lname;
  1106. @@ -1362,8 +1370,8 @@
  1107.  
  1108.  
  1109.  /****************************************************************************
  1110. -do a mget operation on one file
  1111. -****************************************************************************/
  1112. +  do a mget operation on one file
  1113. +  ****************************************************************************/
  1114.  static void do_mget(file_info *finfo)
  1115.  {
  1116.    pstring rname;
  1117. @@ -1406,33 +1414,33 @@
  1118.        strcat(cur_dir,"\\");
  1119.  
  1120.        unix_format(finfo->name);
  1121. -    {
  1122. -      if (lowercase)
  1123. -        strlower(finfo->name);
  1124. +      {
  1125. +    if (lowercase)
  1126. +      strlower(finfo->name);
  1127.  
  1128. -      if (!directory_exist(finfo->name) && mkdir(finfo->name,0777) != 0) 
  1129. -        {
  1130. -          DEBUG(0,("failed to create directory %s\n",CNV_LANG(finfo->name)));
  1131. -          strcpy(cur_dir,saved_curdir);
  1132. -          free(inbuf);free(outbuf);
  1133. -          return;
  1134. -        }
  1135. +    if (!directory_exist(finfo->name) && mkdir(finfo->name,0777) != 0) 
  1136. +      {
  1137. +        DEBUG(0,("failed to create directory %s\n",CNV_LANG(finfo->name)));
  1138. +        strcpy(cur_dir,saved_curdir);
  1139. +        free(inbuf);free(outbuf);
  1140. +        return;
  1141. +      }
  1142.  
  1143. -      if (chdir(finfo->name) != 0)
  1144. -        {
  1145. -          DEBUG(0,("failed to chdir to directory %s\n",CNV_LANG(finfo->name)));
  1146. -          strcpy(cur_dir,saved_curdir);
  1147. -          free(inbuf);free(outbuf);
  1148. -          return;
  1149. -        }
  1150. -    }       
  1151. +    if (chdir(finfo->name) != 0)
  1152. +      {
  1153. +        DEBUG(0,("failed to chdir to directory %s\n",CNV_LANG(finfo->name)));
  1154. +        strcpy(cur_dir,saved_curdir);
  1155. +        free(inbuf);free(outbuf);
  1156. +        return;
  1157. +      }
  1158. +      }       
  1159.  
  1160.        strcpy(mget_mask,cur_dir);
  1161.        strcat(mget_mask,"*.*");
  1162.        
  1163.        do_dir((char *)inbuf,(char *)outbuf,
  1164.           mget_mask,aSYSTEM | aHIDDEN | aDIR,do_mget,False);
  1165. -    chdir("..");
  1166. +      chdir("..");
  1167.        strcpy(cur_dir,saved_curdir);
  1168.        free(inbuf);free(outbuf);
  1169.      }
  1170. @@ -1444,7 +1452,35 @@
  1171.      }
  1172.  }
  1173.  
  1174. +/****************************************************************************
  1175. +view the file using the pager
  1176. +****************************************************************************/
  1177. +static void cmd_more(void)
  1178. +{
  1179. +  fstring rname,lname,tmpname,pager_cmd;
  1180. +  char *pager;
  1181. +
  1182. +  strcpy(rname,cur_dir);
  1183. +  strcat(rname,"\\");
  1184. +  sprintf(tmpname,"/tmp/smbmore.%d",getpid());
  1185. +  strcpy(lname,tmpname);
  1186. +
  1187. +  if (!next_token(NULL,rname+strlen(rname),NULL)) {
  1188. +    DEBUG(0,("more <filename>\n"));
  1189. +    return;
  1190. +  }
  1191. +  dos_clean_name(rname);
  1192. +
  1193. +  do_get(rname,lname,NULL);
  1194. +
  1195. +  pager=getenv("PAGER");
  1196. +  sprintf(pager_cmd,"%s %s",(pager? pager:PAGER), tmpname);
  1197. +  system(pager_cmd);
  1198. +  unlink(tmpname);
  1199. +}
  1200. +
  1201.  
  1202. +
  1203.  /****************************************************************************
  1204.  do a mget command
  1205.  ****************************************************************************/
  1206. @@ -1532,8 +1568,8 @@
  1207.  
  1208.  
  1209.  /****************************************************************************
  1210. -make a directory
  1211. -****************************************************************************/
  1212. +  make a directory
  1213. +  ****************************************************************************/
  1214.  static void cmd_mkdir(char *inbuf,char *outbuf)
  1215.  {
  1216.    pstring mask;
  1217. @@ -1576,8 +1612,8 @@
  1218.  
  1219.  
  1220.  /*******************************************************************
  1221. -write to a file using writebraw
  1222. -********************************************************************/
  1223. +  write to a file using writebraw
  1224. +  ********************************************************************/
  1225.  static int smb_writeraw(char *outbuf,int fnum,int pos,char *buf,int n)
  1226.  {
  1227.    extern int Client;
  1228. @@ -1601,7 +1637,7 @@
  1229.    if (!receive_smb(inbuf,CLIENT_TIMEOUT) || CVAL(inbuf,smb_rcls) != 0)
  1230.      return(0);
  1231.  
  1232. -  _smb_setlen(buf-4,n); /* HACK! XXXX */
  1233. +  _smb_setlen(buf-4,n);        /* HACK! XXXX */
  1234.  
  1235.    if (write_socket(Client,buf-4,n+4) != n+4)
  1236.      return(0);
  1237. @@ -1616,8 +1652,8 @@
  1238.  
  1239.  
  1240.  /*******************************************************************
  1241. -write to a file
  1242. -********************************************************************/
  1243. +  write to a file
  1244. +  ********************************************************************/
  1245.  static int smb_writefile(char *outbuf,int fnum,int pos,char *buf,int n)
  1246.  {
  1247.    pstring inbuf;
  1248. @@ -1655,8 +1691,8 @@
  1249.  
  1250.  
  1251.  /****************************************************************************
  1252. -put a single file
  1253. -****************************************************************************/
  1254. +  put a single file
  1255. +  ****************************************************************************/
  1256.  static void do_put(char *rname,char *lname,file_info *finfo)
  1257.  {
  1258.    int fnum;
  1259. @@ -1714,7 +1750,7 @@
  1260.        return;
  1261.      }
  1262.  
  1263. -    f = fopen(lname,"r");
  1264. +  f = fopen(lname,"r");
  1265.  
  1266.    if (!f)
  1267.      {
  1268. @@ -1776,8 +1812,8 @@
  1269.    SIVAL(outbuf,smb_vwv1,close_time);
  1270.  
  1271.    DEBUG(3,("Setting date to %s (0x%X)",
  1272. -    asctime(LocalTime(&finfo->mtime,LOCAL_TO_GMT)),
  1273. -    finfo->mtime));
  1274. +       asctime(LocalTime(&finfo->mtime,LOCAL_TO_GMT)),
  1275. +       finfo->mtime));
  1276.  
  1277.    send_smb(outbuf);
  1278.    receive_smb(inbuf,CLIENT_TIMEOUT);
  1279. @@ -1785,14 +1821,14 @@
  1280.    if (CVAL(inbuf,smb_rcls) != 0)
  1281.      {
  1282.        DEBUG(0,("%s closing remote file %s\n",smb_errstr(inbuf),CNV_LANG(rname)));
  1283. -    fclose(f);
  1284. +      fclose(f);
  1285.        free(inbuf);free(outbuf);
  1286.        if (buf) free(buf);
  1287.        return;
  1288.      }
  1289.  
  1290.    
  1291. -    fclose(f);
  1292. +  fclose(f);
  1293.    free(inbuf);free(outbuf);
  1294.    if (buf) free(buf);
  1295.  
  1296. @@ -1816,8 +1852,8 @@
  1297.   
  1298.  
  1299.  /****************************************************************************
  1300. -put a file
  1301. -****************************************************************************/
  1302. +  put a file
  1303. +  ****************************************************************************/
  1304.  static void cmd_put(void)
  1305.  {
  1306.    pstring lname;
  1307. @@ -1852,9 +1888,9 @@
  1308.  }
  1309.  
  1310.  /****************************************************************************
  1311. -seek in a directory/file list until you get something that doesn't start with
  1312. -the specified name
  1313. -****************************************************************************/
  1314. +  seek in a directory/file list until you get something that doesn't start with
  1315. +  the specified name
  1316. +  ****************************************************************************/
  1317.  static BOOL seek_list(FILE *f,char *name)
  1318.  {
  1319.    pstring s;
  1320. @@ -1874,8 +1910,8 @@
  1321.  
  1322.  
  1323.  /****************************************************************************
  1324. -set the file selection mask
  1325. -****************************************************************************/
  1326. +  set the file selection mask
  1327. +  ****************************************************************************/
  1328.  static void cmd_select(void)
  1329.  {
  1330.    strcpy(fileselection,"");
  1331. @@ -1884,8 +1920,8 @@
  1332.  
  1333.  
  1334.  /****************************************************************************
  1335. -mput some files
  1336. -****************************************************************************/
  1337. +  mput some files
  1338. +  ****************************************************************************/
  1339.  static void cmd_mput(void)
  1340.  {
  1341.    pstring lname;
  1342. @@ -1900,17 +1936,17 @@
  1343.    while (next_token(NULL,p,NULL))
  1344.      {
  1345.        pstring cmd;
  1346. -      pstring tmpnam;
  1347. +      pstring tmpname;
  1348.        FILE *f;
  1349.        
  1350. -      sprintf(tmpnam,"/tmp/ls.smb.%d",(int)getpid());
  1351. +      sprintf(tmpname,"/tmp/ls.smb.%d",(int)getpid());
  1352.        if (recurse)
  1353. -    sprintf(cmd,"find . -name \"%s\" -print > %s",p,tmpnam);
  1354. +    sprintf(cmd,"find . -name \"%s\" -print > %s",p,tmpname);
  1355.        else
  1356. -    sprintf(cmd,"/bin/ls %s > %s",p,tmpnam);
  1357. +    sprintf(cmd,"/bin/ls %s > %s",p,tmpname);
  1358.        system(cmd);
  1359.  
  1360. -      f = fopen(tmpnam,"r");
  1361. +      f = fopen(tmpname,"r");
  1362.        if (!f) continue;
  1363.  
  1364.        while (!feof(f))
  1365. @@ -1966,13 +2002,13 @@
  1366.        do_put(rname,lname,&finfo);
  1367.      }
  1368.        fclose(f);
  1369. -      unlink(tmpnam);
  1370. +      unlink(tmpname);
  1371.      }
  1372.  }
  1373.  
  1374.  /****************************************************************************
  1375. -cancel a print job
  1376. -****************************************************************************/
  1377. +  cancel a print job
  1378. +  ****************************************************************************/
  1379.  static void do_cancel(int job)
  1380.  {
  1381.    char *p,*rparam,*rdata;
  1382. @@ -1982,13 +2018,13 @@
  1383.    bzero(param,sizeof(param));
  1384.  
  1385.    p = param;
  1386. -  SSVAL(p,0,81); /* api number */
  1387. +  SSVAL(p,0,81);        /* api number */
  1388.    p += 2;
  1389.    strcpy(p,"W");
  1390.    p = skip_string(p,1);
  1391.    strcpy(p,"");
  1392.    p = skip_string(p,1);
  1393. -  SSVAL(p,0,0); /* level 0 */
  1394. +  SSVAL(p,0,0);            /* level 0 */
  1395.    p += 2;
  1396.  
  1397.    if (call_api(PTR_DIFF(p,param),0,
  1398. @@ -2012,8 +2048,8 @@
  1399.  
  1400.  
  1401.  /****************************************************************************
  1402. -cancel a print job
  1403. -****************************************************************************/
  1404. +  cancel a print job
  1405. +  ****************************************************************************/
  1406.  static void cmd_cancel(char *inbuf,char *outbuf )
  1407.  {
  1408.    fstring buf;
  1409. @@ -2037,8 +2073,8 @@
  1410.  
  1411.  
  1412.  /****************************************************************************
  1413. -print a file
  1414. -****************************************************************************/
  1415. +  print a file
  1416. +  ****************************************************************************/
  1417.  static void cmd_print(char *inbuf,char *outbuf )
  1418.  {
  1419.    int fnum;
  1420. @@ -2614,7 +2650,6 @@
  1421.    /* setup the protocol strings */
  1422.    {
  1423.      int plength;
  1424. -    char *p;
  1425.  
  1426.      for (plength=0,numprots=0;
  1427.       prots[numprots].name && prots[numprots].prot<=max_protocol;
  1428. @@ -2790,8 +2825,8 @@
  1429.      }
  1430.  
  1431.        if (Protocol >= PROTOCOL_NT1) {
  1432. -    char *p = smb_buf(inbuf);
  1433.      char *domain,*os,*lanman;
  1434. +    p = smb_buf(inbuf);
  1435.      os = p;
  1436.      lanman = skip_string(os,1);
  1437.      domain = skip_string(lanman,1);
  1438. @@ -3181,10 +3216,12 @@
  1439.    {"dir",cmd_dir,"<mask> list the contents of the current directory"},
  1440.    {"lcd",cmd_lcd,"[directory] change/report the local current working directory"},
  1441.    {"cd",cmd_cd,"[directory] change/report the remote directory"},
  1442. +  {"pwd",cmd_pwd,"show current remote directory (same as 'cd' with no args)"},
  1443.    {"get",cmd_get,"<remote name> [local name] get a file"},
  1444.    {"mget",cmd_mget,"<mask> get all the matching files"},
  1445.    {"put",cmd_put,"<local name> [remote name] put a file"},
  1446.    {"mput",cmd_mput,"<mask> put all matching files"},
  1447. +  {"more",cmd_more,"<remote name> view a remote file with your pager"},  
  1448.    {"mask",cmd_select,"<mask> mask all filenames against this"},
  1449.    {"del",cmd_del,"<mask> delete all matching files"},
  1450.    {"rm",cmd_del,"<mask> delete all matching files"},
  1451. diff -u -r --new-file last-version/source/clitar.c samba-1.9.14alpha9/source/clitar.c
  1452. --- last-version/source/clitar.c    Thu Jul  6 17:37:58 1995
  1453. +++ samba-1.9.14alpha9/source/clitar.c    Fri Jul  7 15:13:34 1995
  1454. @@ -201,14 +201,14 @@
  1455.    if (tp > 0) write(f, tarbuf, S_ISREG(stbuf.st_mode) ? tp : tbufsiz);
  1456.  }
  1457.  
  1458. -static void fixtarname(char *tp, char *fp, int l)
  1459. +static void fixtarname(char *tptr, char *fp, int l)
  1460.  {
  1461.    /* add a '.' to start of file name, convert from ugly dos \'s in path
  1462.     * to lovely unix /'s :-} */
  1463.  
  1464. -  *tp++='.';
  1465. +  *tptr++='.';
  1466.  
  1467. -  while (l--) { *tp=(*fp == '\\') ? '/' : *fp; tp++; fp++; }
  1468. +  while (l--) { *tptr=(*fp == '\\') ? '/' : *fp; tptr++; fp++; }
  1469.  }
  1470.  
  1471.  static void oct_it (register long value, register int ndgs, register char *p)
  1472. @@ -459,8 +459,9 @@
  1473.        while (nread < finfo.size && !close_done)
  1474.      {
  1475.        int method = -1;
  1476. -      char *p=NULL;
  1477.        static BOOL can_chain_close=True;
  1478. +
  1479. +      p=NULL;
  1480.        
  1481.        DEBUG(3,("nread=%d\n",nread));
  1482.        
  1483. @@ -836,7 +837,7 @@
  1484.    return True;
  1485.  }
  1486.  
  1487. -static void unfixtarname(char *tp, char *fp, int l)
  1488. +static void unfixtarname(char *tptr, char *fp, int l)
  1489.  {
  1490.    /* remove '.' from start of file name, convert from unix /'s to
  1491.     * dos \'s in path. Kill any absolute path names.
  1492. @@ -845,7 +846,7 @@
  1493.    if (*fp == '.') fp++;
  1494.    if (*fp == '\\' || *fp == '/') fp++;
  1495.  
  1496. -  while (l--) { *tp=(*fp == '/') ? '\\' : *fp; tp++; fp++; }
  1497. +  while (l--) { *tptr=(*fp == '/') ? '\\' : *fp; tptr++; fp++; }
  1498.  }
  1499.  
  1500.  static long unoct(char *p, int ndgs)
  1501. diff -u -r --new-file last-version/source/fault.c samba-1.9.14alpha9/source/fault.c
  1502. --- last-version/source/fault.c    Thu Jun 29 18:18:03 1995
  1503. +++ samba-1.9.14alpha9/source/fault.c    Thu Jul  6 22:29:44 1995
  1504. @@ -52,11 +52,7 @@
  1505.    DEBUG(0,("===============================================================\n"));
  1506.    
  1507.  #if AJT
  1508. -/* this is for my own private use - it should not normally be defined */
  1509. -    {
  1510. -      pstring cmd = "/usr/bin/X11/xedit -display :0 /tmp/ERROR_FAULT &";
  1511. -      smbrun(cmd,NULL);
  1512. -    }
  1513. +  ajt_panic();
  1514.  #endif  
  1515.  
  1516.    if (cont_fn)
  1517. diff -u -r --new-file last-version/source/ipc.c samba-1.9.14alpha9/source/ipc.c
  1518. --- last-version/source/ipc.c    Thu Jul  6 14:42:19 1995
  1519. +++ samba-1.9.14alpha9/source/ipc.c    Thu Jul  6 22:39:07 1995
  1520. @@ -23,7 +23,6 @@
  1521.     in the SMBtrans protocol
  1522.     */
  1523.  
  1524. -
  1525.  #include "includes.h"
  1526.  #include "loadparm.h"
  1527.  #include "pcap.h"
  1528. @@ -296,9 +295,12 @@
  1529.  #if CHECK_TYPES
  1530.    str = va_arg(args,char*);
  1531.    if (strncmp(str,p->curpos,strlen(str)) != 0) {
  1532. -    DEBUG(2,("type error in package: %s instead of %*s in %s/%s\n",str,
  1533. -          strlen(str),p->curpos,p->format1,p->format2));
  1534. +    DEBUG(2,("type error in package: %s instead of %*s\n",str,
  1535. +          strlen(str),p->curpos));
  1536.      va_end(args);
  1537. +#if AJT
  1538. +    ajt_panic();
  1539. +#endif  
  1540.      return 0;
  1541.    }
  1542.  #endif
  1543. @@ -374,8 +376,8 @@
  1544.  }
  1545.  
  1546.  #if CHECK_TYPES
  1547. -#define PACK(desc,t,v) package(desc,t,v)
  1548. -#define PACKl(desc,t,v,l) package(desc,t,v,l)
  1549. +#define PACK(desc,t,v) package(desc,t,v,0,0,0,0)
  1550. +#define PACKl(desc,t,v,l) package(desc,t,v,l,0,0,0,0)
  1551.  #else
  1552.  #define PACK(desc,t,v) package(desc,v)
  1553.  #define PACKl(desc,t,v,l) package(desc,v,l)
  1554. diff -u -r --new-file last-version/source/local.h samba-1.9.14alpha9/source/local.h
  1555. --- last-version/source/local.h    Thu Jul  6 13:50:28 1995
  1556. +++ samba-1.9.14alpha9/source/local.h    Sun Jul  9 15:12:58 1995
  1557. @@ -67,7 +67,9 @@
  1558.  
  1559.  /* shall filenames with illegal chars in them get mangled in long
  1560.     filename listings? */
  1561. -#define MANGLE_LONG_FILENAMES
  1562. +#if !AJT
  1563. +#define MANGLE_LONG_FILENAMES 
  1564. +#endif
  1565.  
  1566.  /* define this if you want to stop spoofing with .. and soft links
  1567.     NOTE: This also slows down the server considerably */
  1568. @@ -97,6 +99,11 @@
  1569.  #define GUEST_SESSSETUP 0
  1570.  #endif
  1571.  
  1572. +/* the default pager to use for the client "more" command. Users can
  1573. +   override this with the PAGER environment variable */
  1574. +#ifndef PAGER
  1575. +#define PAGER "more"
  1576. +#endif
  1577.  
  1578.  /* the following control timings of various actions. Don't change 
  1579.     them unless you know what you are doing. These are all in seconds */
  1580. diff -u -r --new-file last-version/source/nameserv.c samba-1.9.14alpha9/source/nameserv.c
  1581. --- last-version/source/nameserv.c    Thu Jul  6 17:51:39 1995
  1582. +++ samba-1.9.14alpha9/source/nameserv.c    Sun Jul  9 16:24:33 1995
  1583. @@ -44,6 +44,8 @@
  1584.  static pstring lookup="";
  1585.  static int Client138=-1;
  1586.  
  1587. +enum name_sources {LMHOSTS, REGISTER, SELF, DNS};
  1588. +
  1589.  /* this is the structure used for the local netbios name table */
  1590.  typedef struct
  1591.  {
  1592. @@ -57,7 +59,8 @@
  1593.    BOOL unicast;
  1594.    char name[100];
  1595.    int type;
  1596. -  int count;
  1597. +  int count;  
  1598. +  enum name_sources source;
  1599.  } name_struct;
  1600.  
  1601.  
  1602. @@ -262,14 +265,14 @@
  1603.  /****************************************************************************
  1604.  load a netbios hosts file
  1605.  ****************************************************************************/
  1606. -static void load_hosts_file(char *name)
  1607. +static void load_hosts_file(char *fname)
  1608.  {
  1609.    int i;
  1610. -  FILE *f = fopen(name,"r");
  1611. +  FILE *f = fopen(fname,"r");
  1612.    pstring line;
  1613.    if (!f) 
  1614.      {
  1615. -      DEBUG(2,("Not using non-existant lmhosts file %s\n",name));
  1616. +      DEBUG(2,("Not using non-existant lmhosts file %s\n",fname));
  1617.        return;
  1618.      }
  1619.  
  1620. @@ -309,6 +312,7 @@
  1621.      putip((char *)&names[i].ip,(char *)&a);
  1622.  
  1623.      names[i].valid = True;
  1624. +    names[i].source = LMHOSTS;
  1625.  
  1626.      StrnCpy(names[i].name,name,15);
  1627.      if (strchr(flags,'G') || strchr(flags,'S'))
  1628. @@ -343,6 +347,7 @@
  1629.    names[i].isgroup = True;
  1630.    names[i].valid = True;
  1631.    names[i].type = 0xF0;
  1632. +  names[i].source = SELF;
  1633.  }
  1634.  
  1635.  /****************************************************************************
  1636. @@ -364,6 +369,7 @@
  1637.    names[i].start_time = time(NULL);
  1638.    names[i].ttl = 0;
  1639.    names[i].type = type;
  1640. +  names[i].source = SELF;
  1641.  }
  1642.  
  1643.  /****************************************************************************
  1644. @@ -491,10 +497,10 @@
  1645.  {
  1646.    int level = master?3:0;
  1647.    char *p = inbuf + 12 + name_len(inbuf+12) + 10;
  1648. -  int num_names = CVAL(p,0);
  1649. -  DEBUG(level,("received %d names\n",num_names));
  1650. +  int numnames = CVAL(p,0);
  1651. +  DEBUG(level,("received %d names\n",numnames));
  1652.    p += 1;
  1653. -  while (num_names--)
  1654. +  while (numnames--)
  1655.      {
  1656.        char qname[17];
  1657.        int type;
  1658. @@ -855,28 +861,27 @@
  1659.      ttl = MIN(ttl,NMBD_MAX_TTL);
  1660.  
  1661.      n = find_name(qname,name_type,True);
  1662. -    if (names[n].isgroup) return;
  1663.  
  1664. -    if (n < 0) {
  1665. -      if ((n=add_name())>=0) {
  1666. -    StrnCpy(names[n].name,qname,15);
  1667. -    names[n].type = name_type;
  1668. -    names[n].unicast = !dns_serve || is_mynet(ip);
  1669. -    names[n].ip = ip;
  1670. -    names[n].valid = True;
  1671. -    names[n].ttl = ttl;
  1672. -    names[n].start_time = time(NULL);
  1673. -    DEBUG(2,("Added %s with ttl %d as (%s) (uni=%s)\n",
  1674. -         qname,names[n].ttl,inet_ntoa(ip),BOOLSTR(names[n].unicast)));
  1675. -      }
  1676. -    } 
  1677. -    
  1678. -    if (n>=0 && names[n].ttl>0 && !memcmp(&names[n].ip,&ip,sizeof(ip))) {
  1679. -      names[n].ip = ip;
  1680. -      names[n].ttl = ttl;
  1681. -      names[n].start_time = time(NULL);
  1682. -    }
  1683. -  } 
  1684. +    if (n>=0 && names[n].source != REGISTER && names[n].source != DNS)
  1685. +      return;
  1686. +
  1687. +    if (n<0)
  1688. +      n = add_name();
  1689. +    if (n<0) return;
  1690. +
  1691. +    bzero(&names[n],sizeof(names[n]));
  1692. +
  1693. +    StrnCpy(names[n].name,qname,15);
  1694. +    names[n].type = name_type;
  1695. +    names[n].unicast = !dns_serve || is_mynet(ip);
  1696. +    names[n].ip = ip;
  1697. +    names[n].valid = True;
  1698. +    names[n].ttl = ttl;
  1699. +    names[n].source = REGISTER;
  1700. +    names[n].start_time = time(NULL);
  1701. +    DEBUG(2,("Added %s with ttl %d as (%s) (uni=%s)\n",
  1702. +         qname,names[n].ttl,inet_ntoa(ip),BOOLSTR(names[n].unicast)));
  1703. +  }
  1704.  
  1705.    if (bcast) return;
  1706.  
  1707. @@ -949,17 +954,13 @@
  1708.    DEBUG(2,("Name release request for %s (%s) nb_flags=0x%x ntype=%d\n",
  1709.      qname,inet_ntoa(ip),nb_flags,name_type));
  1710.  
  1711. -
  1712.    n = find_name(qname,name_type,True);
  1713. -  if (n>=0 &&
  1714. -      !names[n].isgroup &&
  1715. -      memcmp(&names[n].ip,&ip,sizeof(ip))==0 &&
  1716. -      names[n].ttl != 0) {
  1717. +  if (n>=0 && names[n].source == REGISTER &&
  1718. +      !memcmp((char *)&ip,(char *)&names[n].ip,sizeof(ip))) {
  1719.      release_ok = True;
  1720.      names[n].valid = False;
  1721.    }
  1722.  
  1723. -
  1724.    /* Send a POSITIVE NAME RELEASE RESPONSE */
  1725.    RSSVAL(outbuf,0,rec_name_trn_id);
  1726.    CVAL(outbuf,2) = (1<<7) | (6<<3) | 4;
  1727. @@ -1019,6 +1020,8 @@
  1728.  
  1729.      if (i < 0)
  1730.        return;
  1731. +    if (names[i].source != SELF && names[i].source != LMHOSTS)
  1732. +      return;
  1733.    }
  1734.  
  1735.    /* Send a POSITIVE NAME STATUS RESPONSE */
  1736. @@ -1120,18 +1123,18 @@
  1737.      if (i < 0)
  1738.        i = find_name(qname,name_type,True);
  1739.      
  1740. -    if (i >= 0 && names[i].unicast && broadcast) {
  1741. -      DEBUG(2,(" - broadcast. No reply\n"));
  1742. -      return;
  1743. -    }
  1744. -  
  1745.      if (i >= 0)
  1746.        {
  1747. +    if (broadcast && (names[i].unicast || names[i].source == REGISTER)) {
  1748. +      DEBUG(2,(" - broadcast. No reply\n"));
  1749. +      return;
  1750. +    }
  1751. +  
  1752.      if (ISGROUP(i)) {
  1753.        DEBUG(2,(" - group name. No reply\n"));
  1754.        return;
  1755.      }
  1756. -    
  1757. +
  1758.      retip = names[i].ip;
  1759.      DEBUG(2,(" sending positive reply\n"));
  1760.        }
  1761. @@ -1167,24 +1170,22 @@
  1762.            DEBUG(2,(" on same subnet (%s), no reply\n",inet_ntoa(retip)));
  1763.            return;
  1764.          }
  1765. +        i = find_name(qname,name_type,True);
  1766. +        if (i < 0) {
  1767. +          if ((i=add_name())>=0) {
  1768. +        StrnCpy(names[i].name,qname,15);
  1769. +        names[i].type = name_type;
  1770. +        names[i].unicast = is_mynet(retip);
  1771. +        names[i].ip = retip;
  1772. +        names[i].valid = True;
  1773. +        names[i].ttl = 120; /* give it two minutes */
  1774. +        names[i].start_time = time(NULL);
  1775. +        names[i].source = DNS;        
  1776. +          }
  1777. +        }
  1778.        }
  1779.      DEBUG(2,(" sending positive reply (%s)\n",inet_ntoa(retip)));
  1780.        }
  1781. -
  1782. -#if 1
  1783. -    i = find_name(qname,name_type,True);
  1784. -    if (i < 0) {
  1785. -      if ((i=add_name())>=0) {
  1786. -    StrnCpy(names[i].name,qname,15);
  1787. -    names[i].type = name_type;
  1788. -    names[i].unicast = is_mynet(retip);
  1789. -    names[i].ip = retip;
  1790. -    names[i].valid = True;
  1791. -    names[i].ttl = 120; /* give it two minutes */
  1792. -    names[i].start_time = time(NULL);        
  1793. -      }
  1794. -    }
  1795. -#endif
  1796.    } else {
  1797.      retip = myip;
  1798.    }
  1799. @@ -1335,7 +1336,7 @@
  1800.  /****************************************************************************
  1801.  construct a host announcement unicast
  1802.  ****************************************************************************/
  1803. -static void announce_host(int i,char *myname,char *comment)
  1804. +static void announce_host(int i,char *my_name,char *Comment)
  1805.  {
  1806.    static int announce_interval = 1;
  1807.    char *group = names[i].name;
  1808. @@ -1352,11 +1353,11 @@
  1809.    DEBUG(2,("Sending host announcement to %s for group %s\n",
  1810.         inet_ntoa(dest_ip),group));       
  1811.  
  1812. -  if (!*comment) comment = "NoComment";
  1813. -  if (!*myname) myname = "NoName";
  1814. +  if (!*Comment) Comment = "NoComment";
  1815. +  if (!*my_name) my_name = "NoName";
  1816.    if (!*group) group = "NoGroup";
  1817.  
  1818. -  if (strlen(comment) > 47) comment[47] = 0;  
  1819. +  if (strlen(Comment) > 47) Comment[47] = 0;  
  1820.  
  1821.    bzero(outbuf,sizeof(outbuf));
  1822.    p = outbuf;
  1823. @@ -1365,7 +1366,7 @@
  1824.    CVAL(p,3) = 0xEA; /* res1 */ 
  1825.    SSVAL(p,4,announce_interval);
  1826.    p += 6;
  1827. -  StrnCpy(p,myname,16);
  1828. +  StrnCpy(p,my_name,16);
  1829.    strupper(p);
  1830.    p += 16;
  1831.    CVAL(p,0) = 1; /* major version (was 1) */
  1832. @@ -1374,10 +1375,10 @@
  1833.    SSVAL(p,6,0x30B); /* election version */
  1834.    SSVAL(p,8,0xAA55); /* browse constant */
  1835.    p += 10;
  1836. -  strcpy(p,comment);
  1837. +  strcpy(p,Comment);
  1838.    p += strlen(p)+1;
  1839.  
  1840. -  send_udp_138(outbuf,PTR_DIFF(p,outbuf),myname,group,0,0x1d,dest_ip);
  1841. +  send_udp_138(outbuf,PTR_DIFF(p,outbuf),my_name,group,0,0x1d,dest_ip);
  1842.  }
  1843.  
  1844.  
  1845. @@ -1568,7 +1569,7 @@
  1846.      struct in_addr ip2;
  1847.      announce_host(i,myname,comment);
  1848.  
  1849. -    if (!name_query(names[i].name,0x1d,False,
  1850. +    if (!name_query(names[i].name,0x1d,True,
  1851.              names[i].master_ip,
  1852.              &ip2,construct_reply)) {
  1853.        DEBUG(2,("%s Master browser at %s failed to respond\n",
  1854. @@ -1678,7 +1679,7 @@
  1855.  /****************************************************************************
  1856.    open the socket communication
  1857.  ****************************************************************************/
  1858. -static BOOL open_sockets(BOOL is_daemon,int port)
  1859. +static BOOL open_sockets(BOOL isdaemon,int port)
  1860.  {
  1861.    struct hostent *hp;
  1862.    
  1863. @@ -1689,7 +1690,7 @@
  1864.        return False;
  1865.      }
  1866.  
  1867. -  if (is_daemon)
  1868. +  if (isdaemon)
  1869.      Client = open_socket_in(SOCK_DGRAM, port,*lookup?3:0);
  1870.    else
  1871.      Client = 0;
  1872. diff -u -r --new-file last-version/source/password.c samba-1.9.14alpha9/source/password.c
  1873. --- last-version/source/password.c    Thu Jul  6 17:46:42 1995
  1874. +++ samba-1.9.14alpha9/source/password.c    Sun Jul  9 15:07:48 1995
  1875. @@ -570,53 +570,7 @@
  1876.  }
  1877.  
  1878.  
  1879. -/****************************************************************************
  1880. -check if a user is in a user list
  1881. -****************************************************************************/
  1882. -BOOL user_in_list(char *user,char *list)
  1883. -{
  1884. -  pstring list2;
  1885. -  char *p;
  1886. -
  1887. -  strcpy(list2,list);
  1888. -
  1889. -  for (p = strtok(list2,LIST_SEP); p; p = strtok(NULL,LIST_SEP))
  1890. -    {
  1891. -      if (strequal(user,p))
  1892. -    return(True);
  1893. -#if HAVE_GETGRNAM 
  1894. -      if (*p == '@')
  1895. -    {
  1896. -          struct group *gptr;
  1897. -          char **member;  
  1898. -      struct passwd *pass = Get_Pwnam(user,False);
  1899. -
  1900. -      if (pass) { 
  1901. -        gptr = getgrgid(pass->pw_gid);
  1902. -        if (gptr && strequal(gptr->gr_name,p+1))
  1903. -          return(True); 
  1904. -      } 
  1905. -
  1906. -      gptr = (struct group *)getgrnam(p+1);
  1907.  
  1908. -      if (gptr)
  1909. -        {
  1910. -          member = gptr->gr_mem;
  1911. -          while (member && *member)
  1912. -        {
  1913. -          if (strequal(*member,user))
  1914. -            return(True);
  1915. -          member++;
  1916. -        }
  1917. -        }
  1918. -    }          
  1919. -#endif
  1920. -    }
  1921. -  return(False);
  1922. -}
  1923. -
  1924. -
  1925. -
  1926.  /****************************************************************************
  1927.  check if a username is valid
  1928.  ****************************************************************************/
  1929. @@ -1156,169 +1110,6 @@
  1930.  #endif
  1931.  
  1932.    return(True);
  1933. -}
  1934. -
  1935. -/****************************************************************************
  1936. -get a users home directory. tries as-is then lower case
  1937. -****************************************************************************/
  1938. -char *get_home_dir(char *user)
  1939. -{
  1940. -  static struct passwd *pass;
  1941. -
  1942. -  pass = Get_Pwnam(user,False);
  1943. -
  1944. -  if (!pass) return(NULL);
  1945. -  return(pass->pw_dir);      
  1946. -}
  1947. -
  1948. -
  1949. -/*******************************************************************
  1950. -map a username from a dos name to a unix name by looking in the username
  1951. -map
  1952. -********************************************************************/
  1953. -void map_username(char *user)
  1954. -{
  1955. -  static int depth=0;
  1956. -  static BOOL initialised=False;
  1957. -  static fstring last_from,last_to;
  1958. -  FILE *f;
  1959. -  char *s;
  1960. -  char *mapfile = lp_username_map();
  1961. -  if (!*mapfile || depth) return;
  1962. -
  1963. -  if (!*user) return;
  1964. -
  1965. -  if (!initialised) {
  1966. -    *last_from = *last_to = 0;
  1967. -    initialised = True;
  1968. -  }
  1969. -
  1970. -  if (strequal(user,last_to)) return;
  1971. -
  1972. -  if (strequal(user,last_from)) {
  1973. -    DEBUG(3,("Mapped user %s to %s\n",user,last_to));
  1974. -    strcpy(user,last_to);
  1975. -    return;
  1976. -  }
  1977. -  
  1978. -  f = fopen(mapfile,"r");
  1979. -  if (!f) {
  1980. -    DEBUG(0,("can't open username map %s\n",mapfile));
  1981. -    return;
  1982. -  }
  1983. -
  1984. -  DEBUG(4,("Scanning username map %s\n",mapfile));
  1985. -
  1986. -  depth++;
  1987. -
  1988. -  for (; (s=fgets_slash(NULL,80,f)); free(s)) {
  1989. -    char *unixname = s;
  1990. -    char *dosname = strchr(unixname,'=');
  1991. -
  1992. -    if (!dosname) continue;
  1993. -    *dosname++ = 0;
  1994. -
  1995. -    while (isspace(*unixname)) unixname++;
  1996. -    if (!*unixname || strchr("#;",*unixname)) continue;
  1997. -
  1998. -    {
  1999. -      int l = strlen(unixname);
  2000. -      while (l && isspace(unixname[l-1])) {
  2001. -    unixname[l-1] = 0;
  2002. -    l--;
  2003. -      }
  2004. -    }
  2005. -
  2006. -    if (strchr(dosname,'*') || user_in_list(user,dosname)) {
  2007. -      DEBUG(3,("Mapped user %s to %s\n",user,unixname));
  2008. -      StrnCpy(last_from,user,sizeof(last_from)-1);
  2009. -      sscanf(unixname,"%s",user);
  2010. -      StrnCpy(last_to,user,sizeof(last_to)-1);
  2011. -    }
  2012. -  }
  2013. -
  2014. -  fclose(f);
  2015. -
  2016. -  depth--;
  2017. -}
  2018. -
  2019. -/****************************************************************************
  2020. -internals of Get_Pwnam wrapper
  2021. -****************************************************************************/
  2022. -static struct passwd *_Get_Pwnam(char *s)
  2023. -{
  2024. -  struct passwd *ret;
  2025. -
  2026. -  ret = getpwnam(s);
  2027. -  if (ret)
  2028. -    {
  2029. -#ifdef GETPWANAM
  2030. -      struct passwd_adjunct *pwret;
  2031. -      pwret = getpwanam(s);
  2032. -      if (pwret)
  2033. -    {
  2034. -      free(ret->pw_passwd);
  2035. -      ret->pw_passwd = pwret->pwa_passwd;
  2036. -    }
  2037. -#endif
  2038. -
  2039. -#if defined(NEXT)&&defined(i386)
  2040. -      /* Workaround for NS 3.2 posix bug in getpwnam() */
  2041. -      if (!ret->pw_uid && ret->pw_short_pad1)
  2042. -    ret->pw_uid = ret->pw_short_pad1;
  2043. -      if (!ret->pw_gid && ret->pw_short_pad2)
  2044. -    ret->pw_gid = ret->pw_short_pad2;
  2045. -#endif
  2046. -
  2047. -    }
  2048. -
  2049. -  return(ret);
  2050. -}
  2051. -
  2052. -
  2053. -/****************************************************************************
  2054. -a wrapper for getpwnam() that tries with all lower and all upper case 
  2055. -if the initial name fails. Also tried with first letter capitalised
  2056. -Note that this changes user!
  2057. -****************************************************************************/
  2058. -struct passwd *Get_Pwnam(char *user,BOOL allow_change)
  2059. -{
  2060. -  fstring user2;
  2061. -
  2062. -  struct passwd *ret;  
  2063. -
  2064. -  if (!user || !(*user))
  2065. -    return(NULL);
  2066. -
  2067. -  StrnCpy(user2,user,sizeof(user2)-1);
  2068. -
  2069. -  if (!allow_change) {
  2070. -    user = &user2[0];
  2071. -  }
  2072. -
  2073. -  map_username(user);
  2074. -
  2075. -  ret = _Get_Pwnam(user);
  2076. -  if (ret) return(ret);
  2077. -
  2078. -  strlower(user);
  2079. -  ret = _Get_Pwnam(user);
  2080. -  if (ret)  return(ret);
  2081. -
  2082. -  strupper(user);
  2083. -  ret = _Get_Pwnam(user);
  2084. -  if (ret) return(ret);
  2085. -
  2086. -  /* try with first letter capitalised */
  2087. -  if (strlen(user) > 1)
  2088. -    strlower(user+1);  
  2089. -  ret = _Get_Pwnam(user);
  2090. -  if (ret) return(ret);
  2091. -
  2092. -  if (allow_change)
  2093. -    strcpy(user,user2);
  2094. -
  2095. -  return(NULL);
  2096.  }
  2097.  
  2098.  
  2099. diff -u -r --new-file last-version/source/reply.c samba-1.9.14alpha9/source/reply.c
  2100. --- last-version/source/reply.c    Wed Jul  5 17:30:13 1995
  2101. +++ samba-1.9.14alpha9/source/reply.c    Fri Jul  7 15:09:51 1995
  2102. @@ -682,7 +682,6 @@
  2103.    }
  2104.  
  2105.    {
  2106. -    char *p;
  2107.      for (p=mask; *p; p++)
  2108.        {
  2109.      if (*p != '?' && *p != '*' && !isdoschar(*p))
  2110. @@ -706,7 +705,7 @@
  2111.    
  2112.    if (can_open)
  2113.      {
  2114. -      char *p = smb_buf(outbuf) + 3;
  2115. +      p = smb_buf(outbuf) + 3;
  2116.        
  2117.        ok = True;
  2118.        
  2119. @@ -1136,7 +1135,6 @@
  2120.    return(True);
  2121.  }
  2122.  
  2123. -
  2124.  /****************************************************************************
  2125.    reply to a unlink
  2126.  ****************************************************************************/
  2127. @@ -2401,6 +2399,20 @@
  2128.    return(True);
  2129.  }
  2130.  
  2131. +/*******************************************************************
  2132. +check if a user is allowed to rename a file
  2133. +********************************************************************/
  2134. +static BOOL can_rename(char *fname,int cnum)
  2135. +{
  2136. +  struct stat sbuf;
  2137. +  int fmode;
  2138. +
  2139. +  if (lstat(fname,&sbuf) != 0) return(False);
  2140. +  fmode = dos_mode(cnum,fname,&sbuf);
  2141. +  if (fmode & aRONLY) return(False);
  2142. +  return(True);
  2143. +}
  2144. +
  2145.  /****************************************************************************
  2146.    reply to a mv
  2147.  ****************************************************************************/
  2148. @@ -2409,7 +2421,6 @@
  2149.    int outsize = 0;
  2150.    pstring name;
  2151.    int cnum;
  2152. -  int dirtype=0;
  2153.    pstring directory;
  2154.    pstring mask,newname;
  2155.    char *p;
  2156. @@ -2448,7 +2459,7 @@
  2157.      strcat(directory,"/");
  2158.      strcat(directory,mask);
  2159.      if (resolve_wildcards(directory,newname) && 
  2160. -    can_delete(directory,cnum,dirtype) && 
  2161. +    can_rename(directory,cnum) && 
  2162.      !rename(directory,newname)) count++;
  2163.    } else {
  2164.      void *dirptr = NULL;
  2165. @@ -2474,7 +2485,7 @@
  2166.  
  2167.          error = ERRnoaccess;
  2168.          sprintf(fname,"%s/%s",directory,dname);
  2169. -        if (!can_delete(fname,cnum,dirtype)) continue;
  2170. +        if (!can_rename(fname,cnum)) continue;
  2171.          strcpy(destname,newname);
  2172.          if (resolve_wildcards(fname,destname) && 
  2173.          !rename(fname,destname)) count++;
  2174. diff -u -r --new-file last-version/source/server.c samba-1.9.14alpha9/source/server.c
  2175. --- last-version/source/server.c    Thu Jul  6 17:54:31 1995
  2176. +++ samba-1.9.14alpha9/source/server.c    Fri Jul  7 15:03:30 1995
  2177. @@ -815,7 +815,7 @@
  2178.  /****************************************************************************
  2179.  open a file with a share mode
  2180.  ****************************************************************************/
  2181. -void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun,int mode,int *access,int *action)
  2182. +void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun,int mode,int *Access,int *action)
  2183.  {
  2184.    int flags=0;
  2185.    int flags2=0;
  2186. @@ -851,18 +851,18 @@
  2187.        case 1: 
  2188.      open_mode2 = 1;
  2189.      flags = O_WRONLY; 
  2190. -    *access = 1;
  2191. +    *Access = 1;
  2192.      break;
  2193.        case 2: 
  2194.        case 0xF: /* XXXX - need to handle FCB open */
  2195.      open_mode2 = 2;
  2196.      flags = O_RDWR; 
  2197. -    *access = 2;
  2198. +    *Access = 2;
  2199.      break;
  2200.        default:
  2201.      open_mode2 = 0;
  2202.      flags = O_RDONLY;
  2203. -    *access = 0;
  2204. +    *Access = 0;
  2205.      break;
  2206.        }
  2207.      open_mode = open_mode2;
  2208. @@ -881,14 +881,14 @@
  2209.        return;
  2210.      }
  2211.      flags = O_RDONLY;
  2212. -    *access = 0;
  2213. +    *Access = 0;
  2214.      open_mode = 0;      
  2215.    }
  2216.  
  2217.    open_file(fnum,cnum,fname,flags|flags2,mode);
  2218.    if (!Files[fnum].open && flags==O_RDWR && errno!=ENOENT) {
  2219.      flags = O_RDONLY;
  2220. -    *access = 0;
  2221. +    *Access = 0;
  2222.      open_mode = 0;
  2223.      open_file(fnum,cnum,fname,flags,mode);
  2224.      if (Files[fnum].open)
  2225. @@ -965,7 +965,7 @@
  2226.      open_mode = 0;
  2227.      share_mode = (deny_mode<<4) | open_mode;
  2228.      DEBUG(2,("Share retry on file %s\n",fname));
  2229. -    open_file_shared(fnum,cnum,fname,share_mode,ofun,mode,access,action);
  2230. +    open_file_shared(fnum,cnum,fname,share_mode,ofun,mode,Access,action);
  2231.      return;
  2232.    }
  2233.  
  2234. @@ -974,7 +974,7 @@
  2235.      open_mode = 1;
  2236.      share_mode = (deny_mode<<4) | open_mode;
  2237.      DEBUG(2,("Share retry 2 on file %s\n",fname));
  2238. -    open_file_shared(fnum,cnum,fname,share_mode,ofun,mode,access,action);
  2239. +    open_file_shared(fnum,cnum,fname,share_mode,ofun,mode,Access,action);
  2240.      return;
  2241.    }
  2242.  
  2243. @@ -1965,13 +1965,13 @@
  2244.  
  2245.    if (*lp_force_user(snum))
  2246.      {
  2247. -      struct passwd *pass;
  2248. +      struct passwd *pass2;
  2249.        fstring fuser;
  2250.        strcpy(fuser,lp_force_user(snum));
  2251. -      pass = (struct passwd *)Get_Pwnam(fuser,True);
  2252. -      if (pass)
  2253. +      pass2 = (struct passwd *)Get_Pwnam(fuser,True);
  2254. +      if (pass2)
  2255.      {
  2256. -      Connections[cnum].uid = pass->pw_uid;
  2257. +      Connections[cnum].uid = pass2->pw_uid;
  2258.        string_set(&Connections[cnum].user,fuser);
  2259.        strcpy(user,fuser);
  2260.        DEBUG(3,("Forced user %s\n",fuser));
  2261. @@ -1995,7 +1995,7 @@
  2262.    if (!IS_IPC(cnum))
  2263.      {
  2264.  
  2265. -      if (-1 == initgroups(pass->pw_name,Connections[cnum].gid))
  2266. +      if (-1 == initgroups(Connections[cnum].user,Connections[cnum].gid))
  2267.      {
  2268.        if (getuid() == 0)
  2269.          {
  2270. @@ -2003,7 +2003,7 @@
  2271.            if (Connections[cnum].gid < 0 || Connections[cnum].gid > 16000 ||
  2272.            Connections[cnum].uid < 0 || Connections[cnum].uid > 16000)
  2273.          DEBUG(0,("This is probably a problem with the account %s\n",
  2274. -             pass->pw_name));
  2275. +             Connections[cnum].user));
  2276.          }
  2277.      }
  2278.        else
  2279. @@ -2050,7 +2050,7 @@
  2280.            Connections[cnum].groups = groups;                
  2281.          }
  2282.          }
  2283. -      DEBUG(3,("%s is in %d groups\n",pass->pw_name,ngroups));
  2284. +      DEBUG(3,("%s is in %d groups\n",Connections[cnum].user,ngroups));
  2285.        for (i=0;i<ngroups;i++)
  2286.          DEBUG(3,("%d ",igroups[i]));
  2287.        DEBUG(3,("\n"));
  2288. @@ -2337,14 +2337,14 @@
  2289.  {
  2290.    extern fstring remote_arch;
  2291.    int outsize = set_message(outbuf,1,0,True);
  2292. -  int index;
  2293. +  int Index;
  2294.    int choice=-1;
  2295.    int protocol;
  2296.    char *p;
  2297.    int bcc = SVAL(smb_buf(inbuf),-2);
  2298.  
  2299.    /* look through the protocol list */
  2300. -  index = 0;
  2301. +  Index = 0;
  2302.    p = smb_buf(inbuf)+1;
  2303.    while (p < (smb_buf(inbuf) + bcc))
  2304.      { 
  2305. @@ -2366,7 +2366,7 @@
  2306.        }
  2307.  
  2308.        p += strlen(p) + 2;
  2309. -      index++;
  2310. +      Index++;
  2311.      }
  2312.  
  2313.  
  2314. @@ -2374,7 +2374,7 @@
  2315.    reload_services(True);      
  2316.  
  2317.    /* a special case to stop password server loops */
  2318. -  if (index == 1 && strequal(remote_machine,myhostname) && 
  2319. +  if (Index == 1 && strequal(remote_machine,myhostname) && 
  2320.        lp_security()==SEC_SERVER)
  2321.      exit_server("Password server loop!");
  2322.    
  2323. @@ -2385,13 +2385,13 @@
  2324.    for (protocol = 0; supported_protocols[protocol].proto_name; protocol++)
  2325.      {
  2326.        p = smb_buf(inbuf)+1;
  2327. -      index = 0;
  2328. +      Index = 0;
  2329.        if (lp_maxprotocol() >= supported_protocols[protocol].protocol_level)
  2330.      while (p < (smb_buf(inbuf) + bcc))
  2331.        { 
  2332.          if (strequal(p,supported_protocols[protocol].proto_name))
  2333. -          choice = index;
  2334. -        index++;
  2335. +          choice = Index;
  2336. +        Index++;
  2337.          p += strlen(p) + 2;
  2338.        }
  2339.        if(choice != -1)
  2340. diff -u -r --new-file last-version/source/smb.h samba-1.9.14alpha9/source/smb.h
  2341. --- last-version/source/smb.h    Thu Jul  6 17:51:56 1995
  2342. +++ samba-1.9.14alpha9/source/smb.h    Fri Jul  7 14:59:25 1995
  2343. @@ -641,7 +641,7 @@
  2344.  void *dptr_fetch_lanman2(char *params,int dptr_num);
  2345.  BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend);
  2346.  void open_file(int fnum,int cnum,char *fname,int flags,int mode);
  2347. -void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun,int mode,int *access,int *action);
  2348. +void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun,int mode,int *Access,int *action);
  2349.  void close_file(int fnum);
  2350.  int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize);
  2351.  int reply_trans(char *inbuf,char *outbuf);
  2352. @@ -777,6 +777,9 @@
  2353.  unsigned long interpret_addr(char *str);
  2354.  void mangle_name_83(char *s, char *MangledMap);
  2355.  BOOL lp_casesignames(void);
  2356. +#if AJT
  2357. +void ajt_panic(void);
  2358. +#endif
  2359.  #ifdef NOSTRDUP
  2360.  char *strdup(char *s);
  2361.  #endif
  2362. diff -u -r --new-file last-version/source/trans2.c samba-1.9.14alpha9/source/trans2.c
  2363. --- last-version/source/trans2.c    Thu Jul  6 13:57:15 1995
  2364. +++ samba-1.9.14alpha9/source/trans2.c    Fri Jul  7 15:09:17 1995
  2365. @@ -168,7 +168,7 @@
  2366.    int16 open_ofun = SVAL(params,12);
  2367.    int32 open_size = IVAL(params,14);
  2368.    char *pname = ¶ms[28];
  2369. -  int16 name_len = strlen(pname)+1;
  2370. +  int16 namelen = strlen(pname)+1;
  2371.  
  2372.    pstring fname;
  2373.    int fnum = -1;
  2374. @@ -178,7 +178,7 @@
  2375.    struct stat sbuf;
  2376.    int smb_action = 0;
  2377.  
  2378. -  StrnCpy(fname,pname,name_len);
  2379. +  StrnCpy(fname,pname,namelen);
  2380.  
  2381.    DEBUG(3,("trans2open %s cnum=%d mode=%d attr=%d ofun=%d size=%d\n",
  2382.         fname,cnum,open_mode, open_attr, open_ofun, open_size));
  2383. @@ -601,7 +601,7 @@
  2384.  
  2385.    /* convert the formatted masks */
  2386.    {
  2387. -    char *p = mask;
  2388. +    p = mask;
  2389.      while (*p) {
  2390.        if (*p == '<') *p = '*';
  2391.        if (*p == '>') *p = '?';
  2392. diff -u -r --new-file last-version/source/username.c samba-1.9.14alpha9/source/username.c
  2393. --- last-version/source/username.c    Thu Jan  1 10:00:00 1970
  2394. +++ samba-1.9.14alpha9/source/username.c    Sun Jul  9 15:07:08 1995
  2395. @@ -0,0 +1,236 @@
  2396. +/* 
  2397. +   Unix SMB/Netbios implementation.
  2398. +   Version 1.9.
  2399. +   Username handling
  2400. +   Copyright (C) Andrew Tridgell 1992-1995
  2401. +   
  2402. +   This program is free software; you can redistribute it and/or modify
  2403. +   it under the terms of the GNU General Public License as published by
  2404. +   the Free Software Foundation; either version 2 of the License, or
  2405. +   (at your option) any later version.
  2406. +   
  2407. +   This program is distributed in the hope that it will be useful,
  2408. +   but WITHOUT ANY WARRANTY; without even the implied warranty of
  2409. +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  2410. +   GNU General Public License for more details.
  2411. +   
  2412. +   You should have received a copy of the GNU General Public License
  2413. +   along with this program; if not, write to the Free Software
  2414. +   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  2415. +*/
  2416. +
  2417. +#include "includes.h"
  2418. +#include "loadparm.h"
  2419. +extern int DEBUGLEVEL;
  2420. +
  2421. +
  2422. +/****************************************************************************
  2423. +get a users home directory. tries as-is then lower case
  2424. +****************************************************************************/
  2425. +char *get_home_dir(char *user)
  2426. +{
  2427. +  static struct passwd *pass;
  2428. +
  2429. +  pass = Get_Pwnam(user,False);
  2430. +
  2431. +  if (!pass) return(NULL);
  2432. +  return(pass->pw_dir);      
  2433. +}
  2434. +
  2435. +
  2436. +/*******************************************************************
  2437. +map a username from a dos name to a unix name by looking in the username
  2438. +map
  2439. +********************************************************************/
  2440. +void map_username(char *user)
  2441. +{
  2442. +  static int depth=0;
  2443. +  static BOOL initialised=False;
  2444. +  static fstring last_from,last_to;
  2445. +  FILE *f;
  2446. +  char *s;
  2447. +  char *mapfile = lp_username_map();
  2448. +  if (!*mapfile || depth) return;
  2449. +
  2450. +  if (!*user) return;
  2451. +
  2452. +  if (!initialised) {
  2453. +    *last_from = *last_to = 0;
  2454. +    initialised = True;
  2455. +  }
  2456. +
  2457. +  if (strequal(user,last_to)) return;
  2458. +
  2459. +  if (strequal(user,last_from)) {
  2460. +    DEBUG(3,("Mapped user %s to %s\n",user,last_to));
  2461. +    strcpy(user,last_to);
  2462. +    return;
  2463. +  }
  2464. +  
  2465. +  f = fopen(mapfile,"r");
  2466. +  if (!f) {
  2467. +    DEBUG(0,("can't open username map %s\n",mapfile));
  2468. +    return;
  2469. +  }
  2470. +
  2471. +  DEBUG(4,("Scanning username map %s\n",mapfile));
  2472. +
  2473. +  depth++;
  2474. +
  2475. +  for (; (s=fgets_slash(NULL,80,f)); free(s)) {
  2476. +    char *unixname = s;
  2477. +    char *dosname = strchr(unixname,'=');
  2478. +
  2479. +    if (!dosname) continue;
  2480. +    *dosname++ = 0;
  2481. +
  2482. +    while (isspace(*unixname)) unixname++;
  2483. +    if (!*unixname || strchr("#;",*unixname)) continue;
  2484. +
  2485. +    {
  2486. +      int l = strlen(unixname);
  2487. +      while (l && isspace(unixname[l-1])) {
  2488. +    unixname[l-1] = 0;
  2489. +    l--;
  2490. +      }
  2491. +    }
  2492. +
  2493. +    if (strchr(dosname,'*') || user_in_list(user,dosname)) {
  2494. +      DEBUG(3,("Mapped user %s to %s\n",user,unixname));
  2495. +      StrnCpy(last_from,user,sizeof(last_from)-1);
  2496. +      sscanf(unixname,"%s",user);
  2497. +      StrnCpy(last_to,user,sizeof(last_to)-1);
  2498. +    }
  2499. +  }
  2500. +
  2501. +  fclose(f);
  2502. +
  2503. +  depth--;
  2504. +}
  2505. +
  2506. +/****************************************************************************
  2507. +internals of Get_Pwnam wrapper
  2508. +****************************************************************************/
  2509. +static struct passwd *_Get_Pwnam(char *s)
  2510. +{
  2511. +  struct passwd *ret;
  2512. +
  2513. +  ret = getpwnam(s);
  2514. +  if (ret)
  2515. +    {
  2516. +#ifdef GETPWANAM
  2517. +      struct passwd_adjunct *pwret;
  2518. +      pwret = getpwanam(s);
  2519. +      if (pwret)
  2520. +    {
  2521. +      free(ret->pw_passwd);
  2522. +      ret->pw_passwd = pwret->pwa_passwd;
  2523. +    }
  2524. +#endif
  2525. +
  2526. +#if defined(NEXT)&&defined(i386)
  2527. +      /* Workaround for NS 3.2 posix bug in getpwnam() */
  2528. +      if (!ret->pw_uid && ret->pw_short_pad1)
  2529. +    ret->pw_uid = ret->pw_short_pad1;
  2530. +      if (!ret->pw_gid && ret->pw_short_pad2)
  2531. +    ret->pw_gid = ret->pw_short_pad2;
  2532. +#endif
  2533. +
  2534. +    }
  2535. +
  2536. +  return(ret);
  2537. +}
  2538. +
  2539. +
  2540. +/****************************************************************************
  2541. +a wrapper for getpwnam() that tries with all lower and all upper case 
  2542. +if the initial name fails. Also tried with first letter capitalised
  2543. +Note that this changes user!
  2544. +****************************************************************************/
  2545. +struct passwd *Get_Pwnam(char *user,BOOL allow_change)
  2546. +{
  2547. +  fstring user2;
  2548. +
  2549. +  struct passwd *ret;  
  2550. +
  2551. +  if (!user || !(*user))
  2552. +    return(NULL);
  2553. +
  2554. +  StrnCpy(user2,user,sizeof(user2)-1);
  2555. +
  2556. +  if (!allow_change) {
  2557. +    user = &user2[0];
  2558. +  }
  2559. +
  2560. +  map_username(user);
  2561. +
  2562. +  ret = _Get_Pwnam(user);
  2563. +  if (ret) return(ret);
  2564. +
  2565. +  strlower(user);
  2566. +  ret = _Get_Pwnam(user);
  2567. +  if (ret)  return(ret);
  2568. +
  2569. +  strupper(user);
  2570. +  ret = _Get_Pwnam(user);
  2571. +  if (ret) return(ret);
  2572. +
  2573. +  /* try with first letter capitalised */
  2574. +  if (strlen(user) > 1)
  2575. +    strlower(user+1);  
  2576. +  ret = _Get_Pwnam(user);
  2577. +  if (ret) return(ret);
  2578. +
  2579. +  if (allow_change)
  2580. +    strcpy(user,user2);
  2581. +
  2582. +  return(NULL);
  2583. +}
  2584. +
  2585. +
  2586. +/****************************************************************************
  2587. +check if a user is in a user list
  2588. +****************************************************************************/
  2589. +BOOL user_in_list(char *user,char *list)
  2590. +{
  2591. +  pstring list2;
  2592. +  char *p;
  2593. +
  2594. +  strcpy(list2,list);
  2595. +
  2596. +  for (p = strtok(list2,LIST_SEP); p; p = strtok(NULL,LIST_SEP))
  2597. +    {
  2598. +      if (strequal(user,p))
  2599. +    return(True);
  2600. +#if HAVE_GETGRNAM 
  2601. +      if (*p == '@')
  2602. +    {
  2603. +          struct group *gptr;
  2604. +          char **member;  
  2605. +      struct passwd *pass = Get_Pwnam(user,False);
  2606. +
  2607. +      if (pass) { 
  2608. +        gptr = getgrgid(pass->pw_gid);
  2609. +        if (gptr && strequal(gptr->gr_name,p+1))
  2610. +          return(True); 
  2611. +      } 
  2612. +
  2613. +      gptr = (struct group *)getgrnam(p+1);
  2614. +
  2615. +      if (gptr)
  2616. +        {
  2617. +          member = gptr->gr_mem;
  2618. +          while (member && *member)
  2619. +        {
  2620. +          if (strequal(*member,user))
  2621. +            return(True);
  2622. +          member++;
  2623. +        }
  2624. +        }
  2625. +    }          
  2626. +#endif
  2627. +    }
  2628. +  return(False);
  2629. +}
  2630. +
  2631. +
  2632. diff -u -r --new-file last-version/source/util.c samba-1.9.14alpha9/source/util.c
  2633. --- last-version/source/util.c    Thu Jul  6 17:59:44 1995
  2634. +++ samba-1.9.14alpha9/source/util.c    Fri Jul  7 15:03:59 1995
  2635. @@ -2523,7 +2523,7 @@
  2636.  /****************************************************************************
  2637.  check if a string is part of a list
  2638.  ****************************************************************************/
  2639. -BOOL in_list(char *s,char *list,BOOL case_sensitive)
  2640. +BOOL in_list(char *s,char *list,BOOL casesensitive)
  2641.  {
  2642.    char *listcopy;
  2643.    char *t;
  2644. @@ -2536,7 +2536,7 @@
  2645.  
  2646.    for (t=strtok(listcopy,LIST_SEP); t; t = strtok(NULL,LIST_SEP))
  2647.      {
  2648. -      if (case_sensitive)
  2649. +      if (casesensitive)
  2650.      {
  2651.        if (strcmp(t,s) == 0)
  2652.          {
  2653. @@ -3885,6 +3885,17 @@
  2654.      sigunblock(block_mask);
  2655.  #endif
  2656.  }
  2657. +
  2658. +#if AJT
  2659. +/*******************************************************************
  2660. +my own panic function - not suitable for general use
  2661. +********************************************************************/
  2662. +void ajt_panic(void)
  2663. +{
  2664. +  pstring cmd = "/usr/bin/X11/xedit -display :0 /tmp/ERROR_FAULT &";
  2665. +  smbrun(cmd,NULL);
  2666. +}
  2667. +#endif
  2668.  
  2669.  #ifdef USE_DIRECT
  2670.  #define DIRECT direct
  2671. diff -u -r --new-file last-version/source/version.h samba-1.9.14alpha9/source/version.h
  2672. --- last-version/source/version.h    Thu Jul  6 18:11:04 1995
  2673. +++ samba-1.9.14alpha9/source/version.h    Sun Jul  9 16:54:33 1995
  2674. @@ -1 +1 @@
  2675. -#define VERSION "1.9.14alpha8"
  2676. +#define VERSION "1.9.14alpha9"
  2677.